jackson1990
Board Regular
- Joined
- Feb 21, 2017
- Messages
- 56
Hey fellow forum posters,
So, I've shifted my focus to a different approach from what I was thinking before. Now I have a macro button. I already have it set to check if D1 contains 1 and if it does to make the copy, as well as making a copy then switching to that copy view. What I want it to do is make a copy of a hidden sheet (sheet2 in this case) that will be not hidden, rename it to template, and switch the view to that. I'm about half way there, but don't quite understand how I get it to copy a hidden sheet to produce a not hidden sheet, as well as renaming it (as it current is just naming it Sheet2 (2). Any help would be greatly appreciated. I've provided my Macro code yet far.
Thanks for any help!
So, I've shifted my focus to a different approach from what I was thinking before. Now I have a macro button. I already have it set to check if D1 contains 1 and if it does to make the copy, as well as making a copy then switching to that copy view. What I want it to do is make a copy of a hidden sheet (sheet2 in this case) that will be not hidden, rename it to template, and switch the view to that. I'm about half way there, but don't quite understand how I get it to copy a hidden sheet to produce a not hidden sheet, as well as renaming it (as it current is just naming it Sheet2 (2). Any help would be greatly appreciated. I've provided my Macro code yet far.
Code:
Sub Test4()'
' Test4 Macro
'
'
If (Range("D1") = "1") Then
Dim ws1 As Worksheet
Set ws1 = ThisWorkbook.Worksheets("Sheet2")
ws1.Copy ThisWorkbook.Sheets(Sheets.Count)
Sheets("Sheet2 (2)").Select
End If
End Sub
Thanks for any help!
Last edited: