LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Some help w/ simple loop, please?

[Excel 2002]
I'm a raw beginner w/ VBA, as evidenced by the simple problem I'm
stumped by...
All I'm trying to do is, starting w/ a clean worksheet, write a sub to
apply the value "55" to ranges beginning w/ "A1:D3", then skipping rows
4 thru 6, then entering value in range "A7:D9", etc., and setting a
stop point around row 36.
So basically, I'm trying to write a simple loop to apply formatting to
alternating bands/ranges, and am using the value "55" as a placeholder.
Here's what I'm trying to make work:

Sub PracticeBanding()
Dim MyRange As Object
Set MyRange = Range("A1:D3").Select
Do Until ActiveCell.Row 36 = True
MyRange.Value = 55
MyRange.Offset(6, 0).Select
Loop
End Sub

So what happens is, As I step through the procedure, it selects the
first range, applies the correct value, offsets down to the next range
just fine...and then fails to apply the values, and just loops back up
to original range and back down to empty range over and over....it
doesn't apply the values after the first range....
I know this is basic as gravity, but I'd sure appreciate someone
helping me with it! Thanks much for your time [:-)

terry b.

 
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
simple loop needed please Alan Excel Discussion (Misc queries) 1 May 5th 10 06:33 PM
I need a simple loop with a 4+ row added in. pgarcia Excel Discussion (Misc queries) 5 July 19th 07 07:42 PM
simple loop macro jim27[_3_] Excel Programming 0 October 17th 04 06:40 PM
simple loop macro jim27[_2_] Excel Programming 0 October 17th 04 06:36 PM
simple loop macro jim27 Excel Programming 2 October 17th 04 06:28 PM


All times are GMT +1. The time now is 01:33 AM.

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

About Us

"It's about Microsoft Excel"