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: 17
Default Variable Range with a loop needed

Ok this is going to be long to explain.

Spreed Sheet has 7 columns and an unknown amount of rows as a total
so columns from A to G
and Rows = unknown

Colum definition

A = Date
B = Account #
C = Type of Account
D = Amount posted (on our system)
E = Amount posted (on an external system)
F = Date when it close
G = Total

now there is several different groups that use the same set up in the same
sheet
What I want to do is to make a macro that copy the value from E to G as follow
E.value = G.Value

The problem I'm having is that I do not have a specific range for each of
this group
I can add or delete rows as I see fit, but the macro needs to keep working
no matter what.

my answer was, I named the very first cell of the group (G1_First) using the
named range option in excel and the very last in that group named it
(G1_Last).

The macro I came up with was:
(Group 1)
For I = Range("G1_First").rows + 1 to Range("G1_Last").rows - 1
Cells(I,7).value = Cells(I,5).value
Next I

after doing this macro i went to the sheet and set it to run automaticaly in
the code of that sheet.

one macro per group 5 in total.

the problem I'm facing is that the loop seens to be very slow, even though,
the amount of rows are less than 1000.

Can anyone come up with a better code for this?
 
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
loop variable range CR[_2_] Excel Programming 3 September 21st 09 06:24 PM
loop variable range Jim Thomlinson Excel Programming 0 September 21st 09 04:28 PM
loop variable range Jim Thomlinson Excel Programming 0 September 21st 09 04:27 PM
loop variable range Dave Peterson Excel Programming 0 September 21st 09 04:24 PM
Loop thru Range Help needed GregR Excel Programming 9 May 12th 06 10:12 PM


All times are GMT +1. The time now is 09:39 PM.

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"