Dynamic selection

Eurekaonide

Active Member
Joined
Feb 1, 2010
Messages
422
Hi All

I have a range that I want to select it starts in column J3 and goes out to column CO. I want it to select it to the bottom and I have tried various things but its not working please help.

I had this but it might go beyond row 33 at some stage but it does work
Set rng = Range("J3:CO33")

I tried this and it didnt like it
Set rng = Range("J3:CO3").Select
Range(Selection, Selection.End(xlDown)).Select

Thanks in advance
 
Okay, if column J will always have data, try this change:

VBA Code:
Lrow = Cells(Rows.Count, 10).End(xlUp).Row
LColumn = Cells(3, Columns.Count).End(xlToLeft).Column

Set rng = Range(Cells(3, 10), Cells(Lrow, LColumn))
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Thanks I finally resolved it like this:


Sheets("Gannt (4)").Select

Application.ScreenUpdating = True

Dim Lastrow As Long
Lastrow = ActiveSheet.Range("J3").CurrentRegion.Rows.Count

Dim Rng As Range


Set Rng = Range("J3:CO" & Lastrow)
Okay, glad you got it sorted.
 
Upvote 0

Forum statistics

Threads
1,215,824
Messages
6,127,103
Members
449,358
Latest member
Snowinx

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