Set range as multiple columns

  • Thread starter Thread starter waveracerr
  • Start date Start date
W

waveracerr

I need to set a range based on 4 variable which represent two columns o
records. I would like something similar to below but this code doe
not function properly. How can I define two ranges within one range?

Eg. Range(Cells(3,3)
Cells(numrow,3):Cells(3,5),Cells(numrow,3)).Select

How do I define this?
Thanks
 
union(Range(Cells(3,3),Cells(numRow,3)),Range(Cells(3,5),Cells(numrow,3)))

Sure your cells are correct

Assume number is 6

Range("C3:C6,E3:C6")

perhaps

union(Range(Cells(3,3),Cells(numRow,3)),Range(Cells(3,5),Cells(numrow,5)))

from the immediate window:
numrow = 6
?
union(Range(Cells(3,3),Cells(numRow,3)),Range(Cells(3,5),Cells(numrow,5))).A
ddress
$C$3:$C$6,$E$3:$E$6
 
Back
Top