findLastRow is a function as follows
Function findLastRow() As Long
Dim lastRow As Long
If WorksheetFunction.CountA(Cells) > 0 Then
'Search for any entry, by searching backwards by Rows.
lastRow = Cells.Find(What:="*", After:=[A1], _...
I need to select dynamic range for formatting. How can I use a variable in VBA for this purpose?
refRow = findLastRow
targetRange = "G3:H" & Format(refRow)
ActiveSheet.Range(targetRange).Select
This code does not work.
Could you help me this?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.