Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default default drop box to a value?

Hello,
I have a drop down box. Can I default it to a value? I
have a macro and I have added a drop box, but would like
it to default to a value. Right now, it leaves it blank.

Please advise any feedback.

Thanks,

Juan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default default drop box to a value?

Juan,

set the listindex property, or less reliably, set the value property of the
combobox. e.g. if the combo is on a form:

Private Sub UserForm_Initialize()
Dim lCount As Long
With ComboBox1
For lCount = 0 To 99
.AddItem lCount
Next lCount
.ListIndex = 0
'or not as reliable
'.Value = 99
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"juan" wrote in message
...
Hello,
I have a drop down box. Can I default it to a value? I
have a macro and I have added a drop box, but would like
it to default to a value. Right now, it leaves it blank.

Please advise any feedback.

Thanks,

Juan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default default drop box to a value?

Hell Robin,
thanks for the info, but I'm not using in a form. I
created a macro to put the drop box on a sheet. Here's the
macro portion:

ActiveSheet.DropDowns.Add(111, 23.25, 75, 15.75).Select
With Selection
.Placement = xlFreeFloating
.PrintObject = True
End With
With Selection
.ListFillRange = "Sheet1!$P$2:$P$13"
.LinkedCell = "$D$1"
.DropDownLines = 8
.Display3DShading = False
End With

What I want is to default it to let say Cell P2 from my
list range.

Please advise.
Thank u for your time.

Juan

-----Original Message-----
Juan,

set the listindex property, or less reliably, set the

value property of the
combobox. e.g. if the combo is on a form:

Private Sub UserForm_Initialize()
Dim lCount As Long
With ComboBox1
For lCount = 0 To 99
.AddItem lCount
Next lCount
.ListIndex = 0
'or not as reliable
'.Value = 99
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"juan" wrote in message
...
Hello,
I have a drop down box. Can I default it to a value? I
have a macro and I have added a drop box, but would like
it to default to a value. Right now, it leaves it blank.

Please advise any feedback.

Thanks,

Juan



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default default drop box to a value?

I've never actually done this before, but it looks like the value property

Sub Test()
ActiveSheet.DropDowns.Add(111, 23.25, 75, 15.75).Select
With Selection
.Placement = xlFreeFloating
.PrintObject = True
End With
With Selection
.ListFillRange = "Sheet1!$P$2:$P$13"
.LinkedCell = "$D$1"
.DropDownLines = 8
.Display3DShading = False
'*************add this
.Value = 1
'*******************
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Juan" wrote in message
...
Hell Robin,
thanks for the info, but I'm not using in a form. I
created a macro to put the drop box on a sheet. Here's the
macro portion:

ActiveSheet.DropDowns.Add(111, 23.25, 75, 15.75).Select
With Selection
.Placement = xlFreeFloating
.PrintObject = True
End With
With Selection
.ListFillRange = "Sheet1!$P$2:$P$13"
.LinkedCell = "$D$1"
.DropDownLines = 8
.Display3DShading = False
End With

What I want is to default it to let say Cell P2 from my
list range.

Please advise.
Thank u for your time.

Juan

-----Original Message-----
Juan,

set the listindex property, or less reliably, set the

value property of the
combobox. e.g. if the combo is on a form:

Private Sub UserForm_Initialize()
Dim lCount As Long
With ComboBox1
For lCount = 0 To 99
.AddItem lCount
Next lCount
.ListIndex = 0
'or not as reliable
'.Value = 99
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"juan" wrote in message
...
Hello,
I have a drop down box. Can I default it to a value? I
have a macro and I have added a drop box, but would like
it to default to a value. Right now, it leaves it blank.

Please advise any feedback.

Thanks,

Juan



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default default drop box to a value?

Hello Robyn,
it seems to work, but now my problme is that it stays the
drop box seems to stay active. Have Squares around it, so
my stops doesn't perform the rest. Is there a way around
this?

really appreciate all the help you are providing.

Thanks,

Juan
-----Original Message-----
I've never actually done this before, but it looks like

the value property

Sub Test()
ActiveSheet.DropDowns.Add(111, 23.25, 75, 15.75).Select
With Selection
.Placement = xlFreeFloating
.PrintObject = True
End With
With Selection
.ListFillRange = "Sheet1!$P$2:$P$13"
.LinkedCell = "$D$1"
.DropDownLines = 8
.Display3DShading = False
'*************add this
.Value = 1
'*******************
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Juan" wrote in message
...
Hell Robin,
thanks for the info, but I'm not using in a form. I
created a macro to put the drop box on a sheet. Here's

the
macro portion:

ActiveSheet.DropDowns.Add(111, 23.25, 75, 15.75).Select
With Selection
.Placement = xlFreeFloating
.PrintObject = True
End With
With Selection
.ListFillRange = "Sheet1!$P$2:$P$13"
.LinkedCell = "$D$1"
.DropDownLines = 8
.Display3DShading = False
End With

What I want is to default it to let say Cell P2 from my
list range.

Please advise.
Thank u for your time.

Juan

-----Original Message-----
Juan,

set the listindex property, or less reliably, set the

value property of the
combobox. e.g. if the combo is on a form:

Private Sub UserForm_Initialize()
Dim lCount As Long
With ComboBox1
For lCount = 0 To 99
.AddItem lCount
Next lCount
.ListIndex = 0
'or not as reliable
'.Value = 99
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"juan" wrote in message
.. .
Hello,
I have a drop down box. Can I default it to a value? I
have a macro and I have added a drop box, but would

like
it to default to a value. Right now, it leaves it

blank.

Please advise any feedback.

Thanks,

Juan


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default default drop box to a value?

Sub Test()
With ActiveSheet.DropDowns.Add(111, 23.25, 75, 15.75)

.Placement = xlFreeFloating
.PrintObject = True
.ListFillRange = "Sheet1!$P$2:$P$13"
.LinkedCell = "$D$1"
.DropDownLines = 8
.Display3DShading = False
'*************add this
.Value = 1
'*******************
End With
End Sub

--
Regards,
Tom Ogilvy

"Juan" wrote in message
...
Hello Robyn,
it seems to work, but now my problme is that it stays the
drop box seems to stay active. Have Squares around it, so
my stops doesn't perform the rest. Is there a way around
this?

really appreciate all the help you are providing.

Thanks,

Juan
-----Original Message-----
I've never actually done this before, but it looks like

the value property

Sub Test()
ActiveSheet.DropDowns.Add(111, 23.25, 75, 15.75).Select
With Selection
.Placement = xlFreeFloating
.PrintObject = True
End With
With Selection
.ListFillRange = "Sheet1!$P$2:$P$13"
.LinkedCell = "$D$1"
.DropDownLines = 8
.Display3DShading = False
'*************add this
.Value = 1
'*******************
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Juan" wrote in message
...
Hell Robin,
thanks for the info, but I'm not using in a form. I
created a macro to put the drop box on a sheet. Here's

the
macro portion:

ActiveSheet.DropDowns.Add(111, 23.25, 75, 15.75).Select
With Selection
.Placement = xlFreeFloating
.PrintObject = True
End With
With Selection
.ListFillRange = "Sheet1!$P$2:$P$13"
.LinkedCell = "$D$1"
.DropDownLines = 8
.Display3DShading = False
End With

What I want is to default it to let say Cell P2 from my
list range.

Please advise.
Thank u for your time.

Juan

-----Original Message-----
Juan,

set the listindex property, or less reliably, set the
value property of the
combobox. e.g. if the combo is on a form:

Private Sub UserForm_Initialize()
Dim lCount As Long
With ComboBox1
For lCount = 0 To 99
.AddItem lCount
Next lCount
.ListIndex = 0
'or not as reliable
'.Value = 99
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"juan" wrote in message
.. .
Hello,
I have a drop down box. Can I default it to a value? I
have a macro and I have added a drop box, but would

like
it to default to a value. Right now, it leaves it

blank.

Please advise any feedback.

Thanks,

Juan


.



.



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
Drop Down Default Bliss Excel Discussion (Misc queries) 1 September 5th 08 09:27 PM
Default to Top of Drop Down List Anita Excel Worksheet Functions 5 December 6th 06 11:22 PM
How do I set cell drag and drop to be on as a default Dick Morgan Excel Discussion (Misc queries) 3 December 5th 05 03:06 PM
Drag&Drop / Cut &Paste default perameters fitzgerak Excel Discussion (Misc queries) 0 March 21st 05 11:09 PM
drop down list default Justin VN Excel Worksheet Functions 2 December 21st 04 08:00 PM


All times are GMT +1. The time now is 04:42 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"