ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determining Start & End Points in Selected Cells (https://www.excelbanter.com/excel-programming/302622-determining-start-end-points-selected-cells.html)

Chris Hankin

Determining Start & End Points in Selected Cells
 
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.



Greg Wilson[_4_]

Determining Start & End Points in Selected Cells
 
Sub GetSelectionInfo()
MsgBox Selection(1).Address
MsgBox Selection(Selection.Count).Address
End Sub

Regards,
Greg

-----Original Message-----
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.


.


Chris Hankin

Determining Start & End Points in Selected Cells
 
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!

Rob van Gelder[_4_]

Determining Start & End Points in Selected Cells
 
Sub GetSelectionInfo()
Selection(1).Interior.ColorIndex = 1
Selection(Selection.Count).Interior.ColorIndex = 1
End Sub

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Chris Hankin" wrote in message
...
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!




Chris Hankin

Determining Start & End Points in Selected Cells
 
Thanks Rob for your help - much appreciated.

Kind regards,

Chris.



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


All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com