Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell access within Selection.Areas
Dim a As Range
Dim cell As Range For Each a In Selection.Areas For Each cell In a Debug.Print cell.Address Next 'cell Next 'a You should add error code in case Selection is not a range. NickHK "maxcad" wrote in message ... I am trying to sequentially access cells with multple selection areas. I know that Selection.Areas(1) is supposed to be the first group of selected cells, but how do I access them? Selection.Areas(1).Cells(1,1) doesn't work. Any insights would be appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell access within Selection.Areas
Private Sub CommandButton1_Click()
Dim area As Range For Each area In Range("rngAreas").Areas With area .Cells(1, 1).Value = "First" .Cells(.Rows.Count, .Columns.Count).Value = "Last" End With Next End Sub NickHK "maxcad" wrote in message ... NickHK, I see how this addesses each cell sequentially. How can I specify certain cells within the selection area? maxcad "NickHK" wrote: Dim a As Range Dim cell As Range For Each a In Selection.Areas For Each cell In a Debug.Print cell.Address Next 'cell Next 'a You should add error code in case Selection is not a range. NickHK "maxcad" wrote in message ... I am trying to sequentially access cells with multple selection areas. I know that Selection.Areas(1) is supposed to be the first group of selected cells, but how do I access them? Selection.Areas(1).Cells(1,1) doesn't work. Any insights would be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
How to access the text selection when user is editing cell | Excel Programming | |||
access specific areas of a protected worksheet | Excel Programming | |||
How to subtract many cell areas (between sheets) | Excel Programming | |||
Selection and Areas | Excel Programming |