return beginning and ending of range

RSXchin

Well-known Member
Joined
Oct 23, 2010
Messages
758
Let's say I highlight rows 5 to 11
How do I tell an event to do the same thing to each of these rows?

I don't have a real application for this at this exact moment, but I can tell it would be beneficial.
 
This is what I was looking for.
I wanted it to do it for column A, no matter where I selected.
Code:
Sub test()
    Dim r As Range
    For Each r In Selection.Rows
        Cells(r.Row, 1) = "This"
    Next r
End Sub
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Let's say I highlight rows 5 to 11
How do I tell an event to do the same thing to each of these rows?

I don't have a real application for this at this exact moment, but I can tell it would be beneficial.
Ah, I get what you mean now. I understood from your original post that you'd be selecting entire rows anyway.
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,172
Members
452,893
Latest member
denay

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