Select Range by Dynamic Attribute

Jasvindra

New Member
Joined
Jul 31, 2018
Messages
38
Hi Team,


Columns("C2:" & ColumnLetter & rwMax).Select

I am trying to select from C2:G16

But Not able to do so with Dynamic values.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
If you are using "Columns", there is no row component.
So just use:
Code:
Columns("C:" & ColumnLetter).Select
 
Upvote 0
Try
Code:
Range("C2", Cells(rwmax, ColumnLetter)).Select
 
Upvote 0
Solution
fIn looking at fluff's reply, it is unclear on whether you are trying to select the whole columns, or only specific rows in those columns.
I was assuming it was "Columns" (thinking, why else would you be using "Columns"?), but that maybe I should have not assumed that.

If you want the entire columns, my solution will work.
If you want just specific rows in those columns, Fluff's will do what you want.


EDIT: I see you clarified it while I was typing this up.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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