Excel

EXCEL vba 특정셀 찾아서 변수(주소or셀위치)저장

SeoHW 2021. 11. 15. 15:36
SMALL

    Cells.Find(What:="찾을셀Text", After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, MatchByte:=False, SearchFormat:=False).Activate

' 현재셀 변수저장

Set nowAddress = Range(ActiveCell.Address)

' 위로한칸이동 (저장할셀로이동)

nowAddress.Offset(-1,0).Select

' 저장할 셀(변수)

Dim adrSave String

adrSave = ActiveCell.Address

 

exam  ) 변수사용시

- Range("A7:" & adrSave)

'  (& 추가)이런식으로 들어간다

LIST