Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tjb
 
Posts: n/a
Default dynamic combo boxes

OK, basically what I want is one combo box with three options: "Yes", "No"
and "Void and Reissue".

When the user selects "Yes" from the first combo box I want a second combo
box to appear and have several options to choose from that are unique to the
"Yes" selection. The options need to by linked to a range of cells (that can
be updated with a link to another file) on the same sheet.

If the user selects "No" from the first combo box I want the second combo
box to appear again and have a different set of options that are unique to
"No". Again the options need to be linked to a range of cells on the same
sheet.

If the user selects "Void and Reissue" then the second combo box will remain
hidden.

If the first combo box is cleared the second combo box should be hidden.

Here's what I've come up with so far:

Private Sub Deduct_Change()
'shows user deduction results
If Deduct.Value = "Yes" Then
Deduct2.Visible = True
Deduct2.ListFillRange = "c127:c129"
End If

If Deduct.Value = "No" Then _
Deduct2.Visible = True
Deduct2.ListFillRange = "c131:c133"
End If

If Deduct.Value = "Void and Reissue" Then _
Deduct2.Visible = False
End If

If Deduct.Value = "" Then _
Deduct2.Visible = False
End If

End Sub

It's not working though. It keeps giving an "End If without Block If" error
when I try to execute.

  #2   Report Post  
 
Posts: n/a
Default

try this:
Private Sub Deduct_Change()
'shows user deduction results
If Deduct.Value = "Yes" Then
Deduct2.Visible = True
Deduct2.ListFillRange = "c127:c129"
else
If Deduct.Value = "No" Then
Deduct2.Visible = True
Deduct2.ListFillRange = "c131:c133"
else
If Deduct.Value = "Void and Reissue" Then
Deduct2.Visible = False
else
If Deduct.Value = "" Then
Deduct2.Visible = False
End If
end if
end if
end if
End Sub

-----Original Message-----
OK, basically what I want is one combo box with three

options: "Yes", "No"
and "Void and Reissue".

When the user selects "Yes" from the first combo box I

want a second combo
box to appear and have several options to choose from

that are unique to the
"Yes" selection. The options need to by linked to a

range of cells (that can
be updated with a link to another file) on the same sheet.

If the user selects "No" from the first combo box I want

the second combo
box to appear again and have a different set of options

that are unique to
"No". Again the options need to be linked to a range of

cells on the same
sheet.

If the user selects "Void and Reissue" then the second

combo box will remain
hidden.

If the first combo box is cleared the second combo box

should be hidden.

Here's what I've come up with so far:

Private Sub Deduct_Change()
'shows user deduction results
If Deduct.Value = "Yes" Then
Deduct2.Visible = True
Deduct2.ListFillRange = "c127:c129"
End If

If Deduct.Value = "No" Then _
Deduct2.Visible = True
Deduct2.ListFillRange = "c131:c133"
End If

If Deduct.Value = "Void and Reissue" Then _
Deduct2.Visible = False
End If

If Deduct.Value = "" Then _
Deduct2.Visible = False
End If

End Sub

It's not working though. It keeps giving an "End If

without Block If" error
when I try to execute.

.

  #3   Report Post  
Tim C
 
Posts: n/a
Default

Try deleting the underscores at the ends of some of your lines.

Tim C

"tjb" wrote in message
...
OK, basically what I want is one combo box with three options: "Yes", "No"
and "Void and Reissue".

When the user selects "Yes" from the first combo box I want a second combo
box to appear and have several options to choose from that are unique to
the
"Yes" selection. The options need to by linked to a range of cells (that
can
be updated with a link to another file) on the same sheet.

If the user selects "No" from the first combo box I want the second combo
box to appear again and have a different set of options that are unique to
"No". Again the options need to be linked to a range of cells on the same
sheet.

If the user selects "Void and Reissue" then the second combo box will
remain
hidden.

If the first combo box is cleared the second combo box should be hidden.

Here's what I've come up with so far:

Private Sub Deduct_Change()
'shows user deduction results
If Deduct.Value = "Yes" Then
Deduct2.Visible = True
Deduct2.ListFillRange = "c127:c129"
End If

If Deduct.Value = "No" Then _
Deduct2.Visible = True
Deduct2.ListFillRange = "c131:c133"
End If

If Deduct.Value = "Void and Reissue" Then _
Deduct2.Visible = False
End If

If Deduct.Value = "" Then _
Deduct2.Visible = False
End If

End Sub

It's not working though. It keeps giving an "End If without Block If"
error
when I try to execute.



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
Dynamic charting problems (events) [email protected] Charts and Charting in Excel 4 January 27th 05 10:32 PM
Indirect and dynamic ranges Sam Excel Worksheet Functions 3 January 24th 05 08:01 AM
combo boxes in pocket excel NCFS 1-3 Excel Discussion (Misc queries) 0 January 22nd 05 10:53 PM
dynamic ranges Sam Excel Worksheet Functions 2 January 21st 05 08:46 PM
How do I autofill combo boxes with their destination cell? Defoes Right Boot Excel Worksheet Functions 3 January 10th 05 01:49 PM


All times are GMT +1. The time now is 11:12 PM.

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"