OleMiss2010
Member
I am trying to write a macro that will auto name certain worksheets under certain conditions but I am missing a key element (see code below):
Sub Sheet_Naming()
Dim ws As Worksheet
Application.Volatile
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Summary" Then
If ws.Range("C5") <> "<>" Then
'I NEED A WAY RIGHT HERE TO SELECT THE FIRST SHEET THAT ISN'T NAME "SUMMARY" TO
'START THE PROGRAM, BUT THE SHEET NAME WILL LIKELY NOT BE CONSISTENT AND THIS
'MACRO NEEDS TO REPEAT FOR ALL SHEETS NOT NAMED "SUMMARY"
ActiveSheets.Name = ActiveSheets.Range("C5")
Sheets("Summary").Select
Next
End If
End If
End Sub
Sub Sheet_Naming()
Dim ws As Worksheet
Application.Volatile
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Summary" Then
If ws.Range("C5") <> "<>" Then
'I NEED A WAY RIGHT HERE TO SELECT THE FIRST SHEET THAT ISN'T NAME "SUMMARY" TO
'START THE PROGRAM, BUT THE SHEET NAME WILL LIKELY NOT BE CONSISTENT AND THIS
'MACRO NEEDS TO REPEAT FOR ALL SHEETS NOT NAMED "SUMMARY"
ActiveSheets.Name = ActiveSheets.Range("C5")
Sheets("Summary").Select
Next
End If
End If
End Sub