Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, Wondering if anyone can help me out. I have a button on a template worksheet that when clicked, copies the template and renames it using the contents of a ComboBox (cmbSelectYear). Code below: Private Sub CommandButton1_Click() Dim StrName As String StrName = cmbSelectYear Worksheets("Template").Copy Worksheets(1) ActiveSheet.Name = StrName End Sub =========================================== I need to add code to this same click event that will check for the existence of a sheet with the same name before copying and renaming. If a sheet doesnt exist to thencontinue normally, otherwise to exit the sub. Can anybody help me, or point me in the right direction? Any help is appreciated. Ben -- benjammind ------------------------------------------------------------------------ benjammind's Profile: http://www.excelforum.com/member.php...o&userid=18217 View this thread: http://www.excelforum.com/showthread...hreadid=382450 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How I stopped a Book 1 opening with existing files | Excel Discussion (Misc queries) | |||
How do I stop Book 1 opening with existing files? | Excel Discussion (Misc queries) | |||
Blank workbook opens when try to open any existing book | Excel Discussion (Misc queries) | |||
formula for check book | Excel Discussion (Misc queries) | |||
Open book, check for macros, close book | Excel Programming |