Macro selecting cells

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,601
Office Version
  1. 2021
Platform
  1. Windows
I would like to macro that will select the first cell column M staring from row 5 up until the last value in Col M

Your assistance in this regard will be most appreciated
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
If you wanted to present the range to the user for modifying or for confirm/stop then you could use this variant

Cheers

Dave

Code:
Sub RangeFlag()
    Dim rng1 As Range
    On Error Resume Next
    Set rng1 = Application.InputBox("Please confirm user selected range", , Range([m5], Cells(Rows.Count, "M").End(xlUp)).Address, , , , , 8)
    On Error GoTo 0
    If Not rng1 Is Nothing Then
        'do something
    Else
        MsgBox "user cancelled", vbCritical
    End If
End Sub
 
Upvote 0
Hi Dave

Thanks for the input, much appreciated.

Regards

Howard
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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