Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The below sub is returning correct cellAddress
============================== Sub Macro1() Dim cell As Range Dim cellAddress As String For Each cell In Range("B1:C3") cellAddress = cell.Address(Null, Null, xlA1, Null, Null) MsgBox (cellAddress) Next End Sub But this is not working - Can't I loop thru the Range like below?======================================== Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim cell As Range Dim cellAddress As String For Each cell In Range cellAddress = cell.Address(Null, Null, xlA1, Null, Null) MsgBox (cellAddress) Next End Sub "Dev" wrote: I have a method which returns Excel selection Range using get_Address() method. I am tyring to return all the cells in that selection range. Ex: If I have selection Range from $A$1:$B$2 (this is my input) then I want to output $A$1 $A$2 $B$1 $B$2 Is it possible to achieve this using Excel OM? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Returning a cell address in a msgbox, by selection via inputbox Ty | Excel Discussion (Misc queries) | |||
cell address for first value to appear in a range | Excel Discussion (Misc queries) | |||
cell address rather than range name | Excel Discussion (Misc queries) | |||
HOW TO: Get cell address from a range | Excel Programming | |||
HOW TO: Get cell address from a range | Excel Programming |