View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Automate cell selection

Sub DemoApproach()
Dim i As Long, rng As Range
Dim cell As Range, sStr As String
For i = 1 To 10
Set rng = Cells(i, 1).Range("A1,C1,E1")
' msgbox rng.Address
For Each cell In rng
sStr = sStr & cell.Address(0, 0) & ","
Next
sStr = Left(sStr, Len(sStr) - 1)
sStr = sStr & vbNewLine
Next
MsgBox sStr
End Sub

--
Regards,
Tom Ogilvy

"mayanklal" wrote:


Hi,
How do I automate cell selection? For example if I want to select cells
A1,C1 and E1 then A2,C2,E2 and so on,each time using the data stored in
these cells.

Thanks,
Mayank.


--
mayanklal
------------------------------------------------------------------------
mayanklal's Profile: http://www.excelforum.com/member.php...o&userid=35236
View this thread: http://www.excelforum.com/showthread...hreadid=551035