Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Eric
 
Posts: n/a
Default How do I advance the range by one row Excell VBA automatically

I am using

Sheets(Array("Breakfast", "Lunch", "Supper", "Bedtime")).Select
Range("B94:D98").Select

but when I run this more than once it overwrites what was put in the first
time.
  #2   Report Post  
 
Posts: n/a
Default

dim rng1 as range
dim rng2 as range
set rng1 = range("B94:D98")
do while something 'or do until something
set rng2 = rng1.offset(1,0)'rng2 is 1 row down from rng1
Sheets(Array
("Breakfast", "Lunch", "Supper", "Bedtime")).Select
'more code??
set rng1 = rng2 'move down 1 row. resets at loop start.
loop
this do loop will move you down the sheet 1 row at a time
each loop.
you will have to have find a way out of the loop or it
will go down to row 65536 and crash on you.
-----Original Message-----
I am using

Sheets(Array

("Breakfast", "Lunch", "Supper", "Bedtime")).Select
Range("B94:D98").Select

but when I run this more than once it overwrites what was

put in the first
time.
.

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
range names Pedro Excel Worksheet Functions 2 January 18th 05 03:38 AM
named range refers to: in a chart Spencer Hutton Excel Discussion (Misc queries) 1 December 14th 04 10:15 PM
range names Pedro Excel Worksheet Functions 1 November 9th 04 06:27 PM
range names Pedro Excel Worksheet Functions 0 November 9th 04 06:26 PM
range name Pedro Excel Worksheet Functions 0 November 9th 04 06:22 PM


All times are GMT +1. The time now is 05:06 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"