Getting error on this line and not sure why. Can someone please help
error message = "Subscript out of Range"
Please Login or Register to view this content.
Getting error on this line and not sure why. Can someone please help
error message = "Subscript out of Range"
Please Login or Register to view this content.
Last edited by biznez; 05-06-2015 at 12:27 PM.
biznez,
Hi again, are you SURE there is a sheet called Input? And if so... are you sure the active workbook at that time is the one that has the worksheet by that name?
Please help by:
Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know
There are 10 kinds of people in this world... those who understand binary, and those who don't.
Hi
Are you sure the sheet tab name is "Input" and not say "Inputs"?
Incidentally you should avoid using the sheet tab name in a macro. One day someone will change the tab name and you'll be stuffed.
Instead use the VBA sheet CodeName
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
Do you have Worksheet named "Input"? Double check for spaces in the name (ie " Input", "Input ", " Input ")
Either you don't have a worksheet named "Input", or you'll have to activate "Input" prior to looking for a value in it.
you could try changing that line to:* Assuming that the code is in the workbook with the sheet "Input"Please Login or Register to view this content.
biznez, glad that worked out. What do you mean hardcode A:L? are those columns the result of formulas and you only want the resulting values, instead of keeping formulas?
biznez, I don't see you pasting any data anywhere in the code you pasted... is there more to the macro, and if so can you provide the rest of the code?
before saving...
Please Login or Register to view this content.
did you put the code in BEFORE the saveas code? if so, then try putting it earlier... before the .copy code.
ok... lets see...
Please Login or Register to view this content.
Thanks Arkadi...u the man!
one more issue if you dont mind. The file that is saved has trailing blank spaces. I want those to be removed. For example file shows as Billy Wilson .xls
Please Login or Register to view this content.
As general advice, keep in mind that when you open or saveas, your active workbook changes. As such it is usually best to be specific about workbook as well as sheet references when working with multiple books, ActiveWorkbook, ThisWorkbook(which is the one containing the macro that is running at the time) are very useful. Or dim variables as workbook and then set them so you can reference them in your code.
Actually you can.... you can rep any post by someone... I have given quite a bit of rep to the same person, sometimes even multiple times on the same thread (not same post though). In fact I would think you have given rep to a few people multiple times, since you get lots of help sometimes from people like John. I once thanked you for rep in a message and asked you don't duplicate... but the duplicate thing was about posting the same problem twice... multiple rep is encouraged if you are helped multiple times by same person. We all help because we can and we like to, rep is purely optional, but always appreciated, it is our only "reward".
Last edited by Arkadi; 05-06-2015 at 12:44 PM.
No problem! Thanks for the rep, and thanks for being so good about marking your threads as Solved, makes our life much easier
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks