How to get a variable range?

luolovepi

Board Regular
Joined
Jun 9, 2011
Messages
116
I want to get a range of cells from column A to D, and a seperate cell with column value J. The row number of these cells depends on the ROW Number I passed into this Sub.
How can I use the Range property to get the expected result?

I write the code like this, but it seems like it is wrong.
Code:
Range("A"&thisRow:"D"&thisRow,"J"&thisRow)
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
try
Code:
Range ("A" & thisRow & ":D" & thisRow & ",J" & thisRow)
 
Upvote 0
Hey, is there an echo in here Peter.....
 
Upvote 0
If I hadn't been reading your PM I would have been able to reply quicker. :)
 
Upvote 0
Ok, OK, that's rubbing it in .....LOL !!
 
Upvote 0
lol..alright~~~
and pls help me check this as well. Don't know where is problem...
I need the cell F42, B42, C6, FthisRow, CthisRow, DthisRow, IthisRow~~~
Code:
Range("F42, B42, F" & thisRow& ", C" & thisRow& ", D" & thisRow& ", C6, I" & thisRow)


Thank you in advance!
If I hadn't been reading your PM I would have been able to reply quicker. :)
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,472
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top