Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Combobox in each wks

I have 12 worksheets, I need to create a combobox in each one with
ListFill Range From A1:A12 in "Utlities" worksheet (separate ws)
Each worksheet should also be named from the A1:A12 range,
e.g.A1 = Thomas
Therefore wks 1 should be called Thomas

the code below doesnt quite work...

Sub combo()
Dim Wks As Worksheet
For Each Wks In Worksheets
Range("a1").Select
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1", Link:=False, _
DisplayAsIcon:=False, Left:=59.75, Top:=5.25, Width:=114, Height:= _
20.25).Select

Next
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Combobox in each wks

With 13 sheets in the workbook, 1 named Utilities and on Utilities, I had
the names of the month in A1:A12, this worked for me:


Sub combo()
Dim Wks As Worksheet
Dim i As Long
Dim ole As OLEObject
i = 0
For Each Wks In Worksheets
If LCase(Wks.Name) < "utilities" Then
Wks.Activate
i = i + 1
Range("a1").Select
Set ole = ActiveSheet.OLEObjects.Add(ClassType:= _
"Forms.ComboBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=59.75, _
Top:=5.25, Width:=114, Height:=20.25)
ole.ListFillRange = "Utilities!A1:A12"
Wks.Name = Worksheets("Utilities").Cells(i, 1).Value
End If
Next
End Sub

--
Regards,
Tom Ogilvy


"teresa" wrote in message
...
I have 12 worksheets, I need to create a combobox in each one with
ListFill Range From A1:A12 in "Utlities" worksheet (separate ws)
Each worksheet should also be named from the A1:A12 range,
e.g.A1 = Thomas
Therefore wks 1 should be called Thomas

the code below doesnt quite work...

Sub combo()
Dim Wks As Worksheet
For Each Wks In Worksheets
Range("a1").Select
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1", Link:=False,

_
DisplayAsIcon:=False, Left:=59.75, Top:=5.25, Width:=114, Height:=

_
20.25).Select

Next
End Sub





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
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
combobox help Tim[_39_] Excel Programming 5 October 26th 04 03:32 PM
Populating combobox from another combobox David Goodall Excel Programming 1 September 12th 04 03:42 PM
ComboBox Darrin Henry Excel Programming 0 September 15th 03 06:05 PM


All times are GMT +1. The time now is 05:08 AM.

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

About Us

"It's about Microsoft Excel"