반응형
Sub 특정단어검색()
Cells.Find(What : = "특정단어", After : = ActiveCell, LookIn :=xFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirectin:=xlNext, _
MatchCase:=False, MatchByte:=False, SearchFormat:=False).Activate
Selection.EntireRow.Insert, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.FormulaR1C1 = "합계"
Set Rng = Range(ActiveCell.Address)
Rng.Offset(0,1).Select '//오른쪽으로이동
ActiveCell.FormulaR1C1 = "=SUM(B2:R[-1]C)" '//합계
ActiveWindow.SmallScroll Down:=-1
Cells.Replace What:="'B2'", Replacement:="B2", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'// B2에 "" 가붙으므로 제거
End Sub
반응형
'프로그램 관련 > 기타' 카테고리의 다른 글
Excel 특정셀 찾아서 셀이동후 지정셀 정렬하기 (0) | 2021.11.12 |
---|