Hello,
Total beginner in VBA.
I`ve been searching the forums without any luck.
First of all, let me explain what i did and what i`m trying to achieve.
I`m trying to do some sort of attendance worksheet in Excel 2019..
So far i`ve been successful following this video :
On the COPY SHEET button (min. 29:20), i`ve pasted the code in the VBA and it does work.
This is my code:
Sub Copyrenameworksheet()
'Updateby Extendoffice
Dim ws As Worksheet
Set wh = Worksheets(ActiveSheet.Name)
ActiveSheet.Copy After:=Worksheets(Sheets.Count)
If wh.Range("E5").Value <> "" Then
ActiveSheet.Name = wh.Range("E5").Value
End If
wh.Activate
End Sub
What i want to do now, is that i want to check if that "E5" sheet name already exists first. If it does it should return a message, if not, create one.
Any help please?
Total noob in programming.
Thank you.
Total beginner in VBA.
I`ve been searching the forums without any luck.
First of all, let me explain what i did and what i`m trying to achieve.
I`m trying to do some sort of attendance worksheet in Excel 2019..
So far i`ve been successful following this video :
This is my code:
Sub Copyrenameworksheet()
'Updateby Extendoffice
Dim ws As Worksheet
Set wh = Worksheets(ActiveSheet.Name)
ActiveSheet.Copy After:=Worksheets(Sheets.Count)
If wh.Range("E5").Value <> "" Then
ActiveSheet.Name = wh.Range("E5").Value
End If
wh.Activate
End Sub
What i want to do now, is that i want to check if that "E5" sheet name already exists first. If it does it should return a message, if not, create one.
Any help please?
Total noob in programming.
Thank you.