Determining Start & End Points in Selected Cells

  • Thread starter Thread starter Chris Hankin
  • Start date Start date
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.
 
Sub GetSelectionInfo()
MsgBox Selection(1).Address
MsgBox Selection(Selection.Count).Address
End Sub

Regards,
Greg
 
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!
 
Sub GetSelectionInfo()
Selection(1).Interior.ColorIndex = 1
Selection(Selection.Count).Interior.ColorIndex = 1
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top