seragrefaat
Board Regular
- Joined
- Nov 16, 2020
- Messages
- 53
- Office Version
- 365
- Platform
- Windows
I have this code modified by member Fluff, and i want to add to it a code for protecting every sheet created with a password. this is the code:
Also I want a code to print the created sheets, but not in the same code that creates and renames them, a different code which i will add it to a command button placed in the Sheet Data.
Thanks in advance
Also I want a code to print the created sheets, but not in the same code that creates and renames them, a different code which i will add it to a command button placed in the Sheet Data.
Thanks in advance
VBA Code:
Private Sub CommandButton1_Click()
Dim cl As Range
Application.ScreenUpdating = False
With Sheets("Data")
For Each cl In .Range("Q4", .Range("Q" & Rows.Count).End(xlUp))
If cl.Value <> "" Then
Sheets("Template").Copy , Sheets(Sheets.Count)
ActiveSheet.Name = cl.Value
ActiveSheet.Range("E4").Value = cl.Value
ActiveSheet.Range("B39").Value = cl.Offset(, 1).Value
.Hyperlinks.Add cl, "", "'" & cl.Value & "'!A1", cl.Value
End If
Next cl
End With
Application.ScreenUpdating = True
End Sub