Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old May 15th 05, 04:42 PM
Jez
 
Posts: n/a
Default Using Combo Boxes as a function

Hi,

I want to have a list in my combo box that once selected it will then on a
new sheet name the sheet tab as selected from my combo box.

so if in my combo box i had:
monday
tuesday
Wednesday

I want to select tuesday and on another sheet it renames the sheet tab with
tuesday.

Thanks,
Jez.

  #2   Report Post  
Old May 16th 05, 11:40 AM
Jason Morin
 
Posts: n/a
Default

Try something like:

Private Sub ComboBox1_Change()

Dim NewSh As Worksheet
Dim ComboBoxVal As String

ComboBoxVal = ComboBox1.Value
Set NewSh = Sheets.Add

On Error GoTo InvalidName
NewSh.Name = ComboBoxVal
Exit Sub

InvalidName:
MsgBox "Invalid name or workhseet with " & _
"the same name already exists."
Application.DisplayAlerts = False
NewSh.Delete
Application.DisplayAlerts = True

End Sub

---
HTH
Jason
Atlanta, GA


"Jez" wrote:

Hi,

I want to have a list in my combo box that once selected it will then on a
new sheet name the sheet tab as selected from my combo box.

so if in my combo box i had:
monday
tuesday
Wednesday

I want to select tuesday and on another sheet it renames the sheet tab with
tuesday.

Thanks,
Jez.



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
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
connecting combo boxes to yield data in another cell. TxN8tv Excel Discussion (Misc queries) 0 March 14th 05 04:07 PM
2 combo boxes Greg Excel Worksheet Functions 1 February 9th 05 11:33 AM
dynamic combo boxes tjb Excel Worksheet Functions 2 January 25th 05 07:33 PM
How do I autofill combo boxes with their destination cell? Defoes Right Boot Excel Worksheet Functions 3 January 10th 05 12:49 PM


All times are GMT +1. The time now is 01:35 AM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017