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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

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