VBA: Make a new sheet if it doesn't exist
Since my last post is pages behind, thought I'd repost to gain further help.
Got this from my initial query (cheers Don Guillett)
Sub mynewsheets()
For Each c In Range("myrange")
On Error Resume Next
If Sheets.Name < c Then
Sheets.Add.Name = c
End If
Next c
End Sub
I changed myrange to Range("B2:B8") where i've put some names. When I run
the macro I get "Compile Error: Method or data member not found" and .Name is
highlighted in the If Sheets.Name < c Then row.
Am I not loading something I should be?
Can anyone help?
|