Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Iterate rows, add like values - an easier way?

I am creating an "input form" - a range of cells for drivers to enter
their daily routes and miles. The route is selected through a Data
Validation in-cell drop down. The same route can be travelled more
than once per day. A Command Button and macro will write this data
into the appropriate worksheets.

I would like to add all the miles for each route to make one entry.
The way I see it, that means the macro must iterate all the rows and
maybe use a Select Case to add all the miles up depending on the route
selected. Is there an easier way, perhaps with a formula in the
worksheet? Or maybe an event triggered when the route is selected
from the Validation list?

Ed
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Iterate rows, add like values - an easier way?

On Apr 3, 6:58*am, Ed from AZ wrote:
I am creating an "input form" - a range of cells for drivers to enter
their daily routes and miles. *The route is selected through a Data
Validation in-cell drop down. *The same route can be travelled more
than once per day. *A Command Button and macro will write this data
into the appropriate worksheets.

I would like to add all the miles for each route to make one entry.
The way I see it, that means the macro must iterate all the rows and
maybe use a Select Case to add all the miles up depending on the route
selected. *Is there an easier way, perhaps with a formula in the
worksheet? *Or maybe an event triggered when the route is selected
from the Validation list?

Ed



After a bit of thought, I hit upon a much easier way. I set up
columns with the forumula "IF(A1 = "Route1",B1,""), copied that down,
and then copied it across and changed the route numbers. I set up a
SUM formula at the end of each column, so I get the total of the
individual route miles at those cells. Now I look in only seven cells
for my data, rather than iterating through 70 cells.

Ed
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
highlight rows for easier reading suesolotel Excel Discussion (Misc queries) 6 January 15th 08 10:12 PM
Iterate Thru Cells Kelvin Excel Programming 4 September 5th 07 10:18 AM
Can't iterate thru a row with For peter Excel Programming 2 January 7th 05 04:46 AM
Iterate through the values in a named range? Brian Excel Programming 1 June 2nd 04 05:04 AM
Iterate columns wired Excel Programming 9 November 14th 03 11:14 PM


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