Hi,
Guys, code createsa copy of sheet “Main” and changes its name to a value from Sheet(1) cell C4.
Could youpls help me and give some advice how to check if the sheet with that namealready exists and if yes, display a msgbox “already exists” with two options: “abort”and “add”. When “add” is chosen, then the“space” (Chr(32)) should be added to the and of the name of the sheet (or twospaces when sheet with one already exists).
This iswhat I got so for:
Sub Adding()
Sheets("Main").Select
Sheets("Main").CopyAfter:=Sheets(2)
Sheets(3).Name= Sheets(1).Range("A4")
End Sub
Thank youin advance
Guys, code createsa copy of sheet “Main” and changes its name to a value from Sheet(1) cell C4.
Could youpls help me and give some advice how to check if the sheet with that namealready exists and if yes, display a msgbox “already exists” with two options: “abort”and “add”. When “add” is chosen, then the“space” (Chr(32)) should be added to the and of the name of the sheet (or twospaces when sheet with one already exists).
This iswhat I got so for:
Sub Adding()
Sheets("Main").Select
Sheets("Main").CopyAfter:=Sheets(2)
Sheets(3).Name= Sheets(1).Range("A4")
End Sub
Thank youin advance