Hello,
I have a function that copies a selected sheet called "05" multiple times and rename the sheets as in column A, However there is a function there that returns the value "" when no additional sheets needed.
The current code is counting the empty cells as it uses the End(xlDown). I want it to ignore the empty "" cells which contains formulas.
The code:
Sub CopyTemplate()
Dim wTemplate As Worksheet
Dim wTOC As Worksheet
Dim wCopy As Worksheet
Dim r As Long
Dim m As Long
Application.ScreenUpdating = False
Set wTemplate = Worksheets("05")
Set wTOC = Worksheets("Data")
m = wTOC.Range("A1").End(xlDown).Row
For r = 2 To m
wTemplate.Copy After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = wTOC.Range("A" & r).Value
Next r
Application.ScreenUpdating = True
End Sub
Thanks a lot in advance!
I have a function that copies a selected sheet called "05" multiple times and rename the sheets as in column A, However there is a function there that returns the value "" when no additional sheets needed.
The current code is counting the empty cells as it uses the End(xlDown). I want it to ignore the empty "" cells which contains formulas.
The code:
Sub CopyTemplate()
Dim wTemplate As Worksheet
Dim wTOC As Worksheet
Dim wCopy As Worksheet
Dim r As Long
Dim m As Long
Application.ScreenUpdating = False
Set wTemplate = Worksheets("05")
Set wTOC = Worksheets("Data")
m = wTOC.Range("A1").End(xlDown).Row
For r = 2 To m
wTemplate.Copy After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = wTOC.Range("A" & r).Value
Next r
Application.ScreenUpdating = True
End Sub
Thanks a lot in advance!