Getting Selected
If macro starts with a selected area (by mouse) how do you get the
corner cells of the selected area? In other words obtain the cell:cell form. Thanks |
Getting Selected
"John" wrote in message ... If macro starts with a selected area (by mouse) how do you get the corner cells of the selected area? In other words obtain the cell:cell form. Thanks you need to use the AddressLocal property of the selected Range. So: strTopLeft = Activesheet.Cells(Selection.Row, Selection.Column).AddressLocal strBottomRight = Activesheet.Cells(Selection.Row+Selection.Rows.Cou nt-1, Selection.Column+Selection.Columns.Count-1).AddressLocal Iain King |
Getting Selected
oops, not quite finished :)
strTopLeft = Activesheet.Cells(Selection.Row, Selection.Column).AddressLocal strBottomRight = Activesheet.Cells(Selection.Row+Selection.Rows.Cou nt-1, _ Selection.Column+Selection.Columns.Count-1).AddressLocal strSelectedRange = strTopLeft+":"+strBottomRight Iain King |
Getting Selected
for a single area:
msgbox Selection.Address(0,0) -- Regards, Tom Ogilvy "John" wrote in message ... If macro starts with a selected area (by mouse) how do you get the corner cells of the selected area? In other words obtain the cell:cell form. Thanks |
All times are GMT +1. The time now is 01:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com