Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Help with creating code??

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Help with creating code??

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Creating Code mate[_2_] Excel Programming 3 March 20th 07 06:30 PM
Code that keeps creating a toolbar - where might that code be hidden? Keith Excel Programming 4 February 12th 07 08:33 PM
Creating new VBA code on the fly Jag Man Excel Programming 1 February 13th 04 12:24 AM
Creating new VBA code on the fly Jag Man Excel Programming 2 February 12th 04 05:06 AM


All times are GMT +1. The time now is 08:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"