• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Dynamic VBA solution for sheet name

Yash1994

New Member
I have one query as i am running below set of do while VBA code and getting error as code is not able to find exact sheet name as "New Consolidated Forecast " (which have space at last in the sheet name).
Also some of the excel templates have sheet name as "New Consolidated Forecast" (without space).
So is there any way to do the compilation as dynamic no matter that particular sheet name have space or not.

VBA Code Screenshot:
vba-code-png.83642



ErrorImage: 83643

Thanks for you help in advance :)
 

Attachments

  • VBA Code.png
    VBA Code.png
    25.6 KB · Views: 40
As 'dynamic' is a non existing Excel word ! As a reminder a true template has fixed things, nothing changes !​
Did you try with the worksheet CodeName ?​
Anyway you must first check the codeline raising the error​
which is the missing important information from your initial post, as guessing can't be helping …​
 
With that what ?‼ o_O As it is at beginner level to check worksheets names …​
And if the so called 'templates' are smart enough designed maybe you can use the worksheet CodeName rather than its name​
or if located always at the same position just with its index.​
 
According to VBA help the classic way for badly designed workbook :​
83648
Do you like it ? So thanks to click on bottom right Like !​
 
Back
Top