Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Windows XP and Excel 2003
The first time through the program should read: With Active Sheet .First = Sheets("Rates").Range("B2") .Second = Sheets("Rates").Range("B3:B186") End With The next time through the Ranges should read "C2" and "C3:C186" Then next time "D2" and "D3:D186" and so on until it reaches "X2"and "X3:X186" Can someone suggest a good way to do this. Please. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'll give you what you need to answer your question, however some of your
syntax doesn't make sense. If you have other questions, come back. Option Explicit Sub test() Dim myRange As Excel.Range Dim r As Excel.Range Dim myWS As Excel.Worksheet Set myWS = Worksheets("Rates") Set myRange = myWS.Range("B2:X2") For Each r In myRange Debug.Print r.Address Debug.Print r.Offset(1, 0).Resize(184, 1).Address 'fill in what you want to do here. Next r End Sub -- HTH, Barb Reinhardt "HarryGuy" wrote: Windows XP and Excel 2003 The first time through the program should read: With Active Sheet .First = Sheets("Rates").Range("B2") .Second = Sheets("Rates").Range("B3:B186") End With The next time through the Ranges should read "C2" and "C3:C186" Then next time "D2" and "D3:D186" and so on until it reaches "X2"and "X3:X186" Can someone suggest a good way to do this. Please. . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks very much to all who responded - very much appreciated.
"Barb Reinhardt" wrote in message ... I'll give you what you need to answer your question, however some of your syntax doesn't make sense. If you have other questions, come back. Option Explicit Sub test() Dim myRange As Excel.Range Dim r As Excel.Range Dim myWS As Excel.Worksheet Set myWS = Worksheets("Rates") Set myRange = myWS.Range("B2:X2") For Each r In myRange Debug.Print r.Address Debug.Print r.Offset(1, 0).Resize(184, 1).Address 'fill in what you want to do here. Next r End Sub -- HTH, Barb Reinhardt "HarryGuy" wrote: Windows XP and Excel 2003 The first time through the program should read: With Active Sheet .First = Sheets("Rates").Range("B2") .Second = Sheets("Rates").Range("B3:B186") End With The next time through the Ranges should read "C2" and "C3:C186" Then next time "D2" and "D3:D186" and so on until it reaches "X2"and "X3:X186" Can someone suggest a good way to do this. Please. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Increasing alphabectically | Excel Programming | |||
Increasing alphabectically | Excel Programming | |||
Increasing numbers. | Excel Discussion (Misc queries) | |||
Increasing Row Value | Excel Programming | |||
Increasing M in M/D/Y | Excel Discussion (Misc queries) |