I want to be able have it only warn me there is already a sheet with that name but not copy the original with the (#). I have about 24 of these now. Temp (#).![]()
Please Login or Register to view this content.
I want to be able have it only warn me there is already a sheet with that name but not copy the original with the (#). I have about 24 of these now. Temp (#).![]()
Please Login or Register to view this content.
Last edited by LightHeart7; 02-03-2015 at 01:07 PM.
You have commented out a line... without that line your macro does not check whether that sheet already exits. So your macro would not detect the condition of duplicate names. If you re-enable the "set wsNew..." line then it should skip over the copy and rename part of the program.
Also if you want a message then just before
add a line:![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
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.
I stopped that line because every time it went to that line it kept giving me Subscript out of range. When i took it out it worked until i got to where it was getting same name tabs
Hi there,
Ensure this part...
...of this line of code:![]()
Please Login or Register to view this content.
is not blank or can be a valid sheet name i.e. not greater than 31 characters for example.![]()
Please Login or Register to view this content.
You do need some code to check if the proposed tab name already exists in the workbook or not.
Regards,
Robert
____________________________________________
Please ensure you mark your thread as Solved once it is. Click here to see how
If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post
It is not blank, really it should be one_two as the page but i'm still getting it as an error. Is there a code that will just make it skip that error? so the warning stops coming up and either skips it or continues on?
I've tried un-commentingbut i'm still just getting out of range even when i change sheets to worksheets.![]()
Please Login or Register to view this content.
I think you have your VB editor set to break on all errors, which is the only reason your On Error Resume Next statement would be ignored.
Everyone who confuses correlation and causation ends up dead.
Yes, that is exactly it. It was on break on all errors. is it normally supposed to be on Class Module or unhanded errors? Its working like a charm now. Thank you so much. Such a easy thing to miss!
I always have it set to break in class modules.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks