cyberchief Posted May 17, 2005 Report Share Posted May 17, 2005 I am building a macro that will log a customer billed amount for an entire history into an excel spreadsheet. I will have the Macro pull up the most current month, find the amount, and log that into %T10%. I then have it issue a command to go back 1 month and do the same. Here is where I am having issues... I want to set that next amount to %T11%... and repeat the process until there are no more invoices to go back to (if there is another previous month, set that to %T12% and keep going until screen contains "requested bill not found"). This will run in a loop for multiple accounts on a spreadsheet. Problem is that each account will have a different amount of invoices going back... 1 account could only have 2 invoices (so only T10 and T11), but some may go back 30 months. Is there a way to create the new varialbes without having to write them all out? I don't want to have to write code out to set 100 variables so that, just in case, I am covered for all months... I want it to only set the new variable IF there is a previous bill... and continue to do so until there are no more invoices. After each account's history has been logged, those figures will be input into a spreadsheet and the variables will be cleared... but I need to log up to a possible 36 or so (3 years). Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.