I searched for this for a while, and I did not succeed.
I am trying to use the range with cells command in VBA, and the last line is a variable. Moreover, I do not get consecutive columns.
I need to select the range S2:S9 and U2:U9 (as already mentioned, the last line can be a variable). I know this command works:
Range(Cells(2, 19), Cells(NumberofRows, 19)).select
But I need to select 2 different columns that are not consecutive. I try something like this, but do not have time:
Range(Cells(2, 19), Cells(NumLinhas, 19);(Cells(2, 21), Cells(NumLinhas, 21)).Select
Does anyone know how to do this?
source share