Home > OS >  Correct entry range vba excel
Correct entry range vba excel

Time:11-23

I have a record but it gives an error

Set range5 = sht3.Range("B"   fcell.Row   1   ":D"   lLastRow2)

fcell is Find = 30
lLastRow2 = 31

I want to write in one line

Set range5 = sht3.Range("B31:D31")

fcell and lLastRow2 these are dynamic values

CodePudding user response:

What about concatenating:

Set range5 = sh3.Range("B" & fcell.Row   1 & ":D" & lLastRow2)
  • Related