Select specific range starting with active cell

Brink9

New Member
Joined
Jun 7, 2018
Messages
4
I’m trying to figure out how to select a specific range using vba code. I know how to select the active cell. Once I have the active cell, I’d like to select a range from the active cell to a fixed, non changing cell. For example, if the active cell is a14 and the fixed cell is i49. The active cell can change from a14 to a49, but i49 must stay fixed.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try this:
Code:
Sub Test()
'Modified 6/7/2018 10:45 PM  EDT
Application.ScreenUpdating = False
Range(Cells(ActiveCell.Row, ActiveCell.Column), Cells(49, ActiveCell.Column)).Select
Application.ScreenUpdating = True
End Sub
 
Upvote 0
I was a little confused about this:
The active cell can change from a14 to a49, but i49 must stay fixed.

It appears your saying the column may change but not the row.

you used a then i
 
Upvote 0
Thanks for the quick response My answer is this! Maybe this will make more sense. Let’s say I have a range of cells I’m working with (A14:I49) in which data entries can happen in (A14:A49). Then data is entered only into cells A14, A15, and A16 for example. I then want to use a macro to find the active cell next in line (A17, in this case), and then select a range from the active cell to cell “I49”. Basically I just want to select a range that looks like (“ActiveCell:I49)

Thanks
 
Upvote 0
Basically I’d like to select a range that looks like (“ActiveCell:I49”). Not sure if this is possible, but was curious if it could be found using a macro.
 
Upvote 0
Code:
Range(ActiveCell.Address(0, 0) & ":I49").Select

The suggestion by My Answer Is This will work if you change it to
Code:
Range(Cells(ActiveCell.Row, ActiveCell.Column), Cells(49, 9)).Select
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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