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: 364
Default looping question

i am trying to create a loop with for and next statements. i have 12 sheets,
one for each month i want to have the user select the month from the
dropdown, build a report using that month as the end month and create a
report giving totals for that period.

for example, i set an sname variable jan, sname variable to feb.
when the dropdown = jan it sets the cnt variable to 1, .
when the dropdown = feb it sets the cnt variable to 2, and an if statement
sets the sname to feb

so if the dropdown = jan it goes to the jan sheet and copies and adds the
values to the report sheet.
if the dropdown = feb it goes to the feb sheet, copies the data, changes
the counter by one and is supposed to set the cnt variable to 1 less than it
was, 1 instead of 2.

if it get it to loop, it always copies the same month for whatever the cnt
variable is. if i choose april, i get the totals from april 4 times, may 5
times an so on.

i am having a hard time with the next statement choosing the next sheet. i
think i have variables for each month correctly set up, i just need help
telling the script to goto the next sheet after if finished copying the
sheet it's on.

hopefully you can understand, if it's too involved, please don't waste your
time writing a lot of code

--


Gary



 
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
Looping Question lee New Users to Excel 3 August 4th 06 04:23 PM
looping question luke New Users to Excel 4 June 3rd 05 01:19 PM
Looping question Charles Excel Programming 2 April 20th 05 11:32 PM
Looping Question MWS Excel Programming 3 November 12th 04 05:32 PM
Looping Question? Michael168[_56_] Excel Programming 2 November 7th 03 12:45 PM


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