View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default syntax for range selection

Option Explicit
Sub testme02()
Dim iRow As Long
Dim FirstRow As Long
Dim LastRow As Long
Dim myStep As Long

myStep = 10
With ActiveSheet
FirstRow = 2
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For iRow = FirstRow To LastRow Step myStep
With .Cells(iRow, "A").Resize(myStep, 2)
'do your formatting or...
MsgBox .Address
End With
Next iRow
End With
End Sub

saziz wrote:

Hi folks,
I have a range say from A2:B11 on a sheet
range ("A2:B11").select
with selection I am formating a bunch of things
then I like to select an identical range below that
range ("A12:B21")
What would be the syntax for this increment in range?
Then I am going to repeat the formating steps on this range.
It would do this untill the end of data.
Appreciate your help please.
Thanks
Syed

--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=498394


--

Dave Peterson