Need help for macro to Shift Select

pandatastic

New Member
Joined
Feb 2, 2018
Messages
3
Hi,

Here is my current macro

Range("b1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.Offset(0, -1)).Select

What I need it to do is to select one less cell counting from the right. Becaseu ctrl+shift selects until the filled cell, but I only need to select until the empty cell.

Any other suggestions are more than welcomed!


Thank you!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Welcome to the Board!

I am not quite sure it is totally clear exactly what you are after. Can you describe an actual example for us?
Like if cells B1:E10 were all filled out, which cell do you want to select and why?
 
Upvote 0
Welcome to the Board!

I am not quite sure it is totally clear exactly what you are after. Can you describe an actual example for us?
Like if cells B1:E10 were all filled out, which cell do you want to select and why?

of course!

So I have formulas in cell C2:H2, A2:B2 are filled, so is I2 and further.
My spreadsheet has 300,000+ rows, and the number of rows change from month to month depending on the adjustments I make.
I would like to fill the formulas of C2:H2 downward until the last row.


Thank you!
 
Upvote 0
Try this:
Code:
    Dim lRow As Long
'   User column A to find last row of data
    lRow = Cells(Rows.Count, "A").End(xlUp).Row
'   Autofill columns C-H down to last row
    Range("C2:H2").AutoFill Destination:=Range("C2:H" & lRow), Type:=xlFillDefault
 
Last edited:
Upvote 0
You are welcome.
Glad I could help!:)
 
Upvote 0

Forum statistics

Threads
1,224,540
Messages
6,179,417
Members
452,912
Latest member
alicemil

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