When I use Sheets.Add the debugger stops the program, highlights .Add and states "method or data member not found"? Also I noticed that when I typed Sheets. the box comes up with the choices of actions that can be picked and Add is not one of them.
I'm going back to the beginning, this is the original code that worked fine in version '03. There's many sheets in the workbook and when this code is activated I want to hide all sheets from view. It is suppose to create a blank "sheet1", because a workbook needs at least 1 sheet, and hide all the rest. This workbook has a lot of user forms and modules and I had to fix a lot of them when I switch to Excel '10. This one I can't seem to get to work. Any suggested fixes or rewrites would be appreciated.
Dim ws As Worksheet
'Program steps through each worksheet making them invisible
'leaving sheet1 visible. Workbook must have at least 1 sheet
Set newsheet = Worksheets.Add
newsheet.Name = "Sheet1"
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "Sheet1" Then
ws.Visible = True
Else: ws.Visible = xlSheetVeryHidden