Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default syntax for range selection


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default syntax for range selection


For the help. It worked out very well.
sye

--
sazi
-----------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...nfo&userid=635
View this thread: http://www.excelforum.com/showthread.php?threadid=49839

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Using ColumnNumber in Range syntax Hari Prasadh[_2_] Excel Programming 9 August 20th 05 02:01 PM
Range syntax Dr.Schwartz Excel Programming 4 May 27th 05 01:34 PM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM
Syntax - Add Range Name based on Selection Bruce Roberson Excel Programming 2 August 8th 03 10:13 PM


All times are GMT +1. The time now is 06:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"