Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am looking for some help on creating code to do the following.
1)create a new sheet from a formated(already created) sheet 2)name the new sheet what the combobox selection is, if it already exsists have it alow the user to select another name 3)select the data(stored on two other sheets) for the new sheet based off of a combobox selection 4)copy the data to the new sheet And the kicker is I want all this to happen with the click of a button |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Nov 6, 11:43 am, Mekinnik
wrote: I am looking for some help on creating code to do the following. 1)create a new sheet from a formated(already created) sheet 2)name the new sheet what the combobox selection is, if it already exsists have it alow the user to select another name 3)select the data(stored on two other sheets) for the new sheet based off of a combobox selection 4)copy the data to the new sheet And the kicker is I want all this to happen with the click of a button ========================= Create a menu button and attach this code: Sub CopySheet() NewName = InputBox("New Name") If NewName = "" Then Exit Sub End If ActiveSheet.Copy befo=Sheets(2) NewSheet = ActiveSheet.Index SheetCount = Sheets.Count IsNewName = False Do Until IsNewName = True For s = 1 To SheetCount If Sheets(s).Name = NewName Then NewName = InputBox("New Name") Exit For End If Next s IsNewName = True Loop Sheets(NewSheet).Name = NewName End Sub Hope this helps meg99 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help Creating Code | Excel Programming | |||
Code that keeps creating a toolbar - where might that code be hidden? | Excel Programming | |||
Creating new VBA code on the fly | Excel Programming | |||
Creating new VBA code on the fly | Excel Programming |