Situation... I have inheirited a fairly involved excel macro and am running into a problem... THis macro imports a number of files as seperate worksheets, then reorganizes the data in the worksheets and copies it to a central sheet and does some calucations... THe problem is that the macro has a section for editing each workstheet... THere is a sample below... Basically, the script runs "Batch1_GETS, Batch2_GETS, and so on till Batch8_GETS, This edits the data on th worksheet and then copies data to another worksheet after the fact (ParaSoft_Data) for additional calculations... IT woks fine, but the problem is that now the number of batches has now started varying. Now alot of the time we only get Batch 1-6, but we still on occation get 8, so I don't want to remove that section of the code in the macro... The problem is that since there is no Batch7/8 worksheet that when it gets to the Batch7_GETS section in the macro, it causes problems.
Normally, i would a IF NOT EXIST/ GOTO statement... Basically, I would note in the code - that if something didn't exist (ie Batch7/8_GETS worksheets) it would just skip that section and go on... I know that excel has IF/ElSE statements - but I can't get it work... So I figured I would ask... I would think it shouldn't be too difficult, so if anyone if familiar, I would appreciate some help....
Ultimately, I would prefer to loop the BatchX_GETS statements, so there wasn't a seperate piece for each workbook, but one thing at a time...
Thansks in advance..
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzerPlease Login or Register to view this content.
Bookmarks