PDA

View Full Version : Solved: how to use variables with rows selection



paul_0722
05-14-2008, 11:00 PM
A VBA newbie qeustion...

I want to copy rows of data using something like Rows("A3:B5").Select but the values of the range to be used are stored in an array called data() so I want to say something like Rows(data(1):data(2)).Select - but the VBA complier is saying that isn't allowed!

Can someone point me in the right direction? ...many thanks

paul_0722
05-14-2008, 11:05 PM
Sorry, I should have said Rows(3:5).Select as an example or Range(A3:B5).Select

Bob Phillips
05-15-2008, 12:19 AM
Rows(start_row_num & ":" & end_row_num)


or



Rows(start_row_num).Resize(end_row_num - start_row_num + 1)

paul_0722
05-15-2008, 01:46 PM
That works - thanks very much!