This is my current code. Currently the worksheet is named "blank". I need this code to execute even if I change the name. Currently it throws me an error.Please Login or Register to view this content.
This is my current code. Currently the worksheet is named "blank". I need this code to execute even if I change the name. Currently it throws me an error.Please Login or Register to view this content.
Your Worksheets("blank") is part of the worksheets collection.
Try using indices like worksheets(1) to refer to the first
Or Worksheets(Worksheets.count) to refer to the last worksheet
Gr,
Ricardo
Your last suggestion works fine so far. Thank You.
Well I jumped the gun it seems. Once i close and reopen it only updates the first sheet and not the one recently copied. I am thinking there is an activesheet reference that I could use perhaps...
Are you running the code whilst "blank" is active? If so the use
If not you need to get the sheets Code Name. If you look at the Properties Window of the VB Editor you will see the workbooks & their sheets listed., eg Sheet1(Blank). Sheet1 is what you want.Please Login or Register to view this content.
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Is this what you mean?When I do this i get a error on that line. Perhaps its something I am not understanding.Please Login or Register to view this content.
Why don't you name a range in that worksheet i.e. "SheetName"
then fut this formula in it:
Then use:Please Login or Register to view this content.
THis way whenever you change the sheet name the cell will change and you will always be refering to the correct sheet!! ?Please Login or Register to view this content.
Mr MaGoo
Magoo.Inc MMVII
If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks