Hi, I attached my workbook so you guys can easily take a look.
In this workbook I have 2 hidden worksheets.
To start off, you click the Add Week button, put in a date (mm-dd-yy), that brings up the sheet thats named with the date you just put in the text box. (Which happens to be placed in the wrong spot) In that sheet that appears theres a button to "Delete last" which is suposed to delete the last sheet in the worksheet but the new sheet gets placed between the existing charts. Thats my first problem.
Next, when you hit the delete button, my VBA code is set to make one of the hidden sheets visible so it can delete one of the rows.
Sheets("Total WO Table").Visible = True
Its fine deleteing the row, but when I go back and select this sheet again I get an error with the selection.
Worksheets("Total WO Table").Select
even though I have the exact same line of code just before and it doesnt give me an error.
Heres a snipet of the code but you guys can take a look at the actual file for the full thing.
Sheets("Total WO Table").Visible = True
Worksheets("Total WO Table").Select
Sheets("Total WO Table").Move Before:=Sheets(4)
Worksheets(Worksheets.Count).Select
nameD = ActiveSheet.name 'Name of last sheet as variable
ActiveWindow.SelectedSheets.Delete 'Deletes last sheet
Worksheets("Total WO Table").Select '<--- This is where error occurs.
Bookmarks