Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim myRng as range
set myRng = selection.areas(1) msgbox myrng.cells(1).address msgbox myrng.cells(myrng.cells.count).address I used Areas(1) just in case you have more than one area selected. John wrote: 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 -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple cells or columns are selected instead of selected cell or | Excel Discussion (Misc queries) | |||
Cells are selected but aren't displayed as selected | Excel Discussion (Misc queries) | |||
Cells are selected but aren't displayed as selected | Excel Worksheet Functions | |||
A validated List which link to selected cells according to what is selected on the list | Excel Worksheet Functions | |||
how do i make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. | Excel Worksheet Functions |