Determining Start & End Points in Selected Cells

C

Chris Hankin

Hello,

Could someone please help me with the following:

When a user selects a row of cells, I wish to determine the beginning and &
end cell of their selection.

The row selected is a single row.

The row length may vary.

Kind regards,

Chris.
 
G

Greg Wilson

Sub GetSelectionInfo()
MsgBox Selection(1).Address
MsgBox Selection(Selection.Count).Address
End Sub

Regards,
Greg
 
C

Chris Hankin

Thanks Greg for your e-mail reply - much appreciated.

The reason I wanted the beginning and end cell addresses when a user
selects a single row of cells at random, is that I wanted to color the
first and last cell in their selection with the color black (Excel color
number is 1).

Could you please advise on how I may achieve this.

Kind regards,

Chris.



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
R

Rob van Gelder

Sub GetSelectionInfo()
Selection(1).Interior.ColorIndex = 1
Selection(Selection.Count).Interior.ColorIndex = 1
End Sub
 
Top