Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Combobox not writing value if next selection is same

Hello

The code I have below works very well to write the value chosen in the combobox to teh appropriate cell in a list. The problem I have is if the value chosen the next time I use the combobox is the same as the previous, nothing will be written. I have tried using an if/then/else to compare the previous cell to the value and using the Range statement below for true and false but it did not work. Can someone please offer some code options

Thank you, Jo

Dim drpdwn As DropDow
Set drpdwn = ActiveSheet.DropDowns(Application.Caller
With drpdw
Range("b1").End(xlDown).Offset(1, 0).Value = .List(.ListIndex
End Wit
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Combobox not writing value if next selection is same

I think I'd just clear the dropdown and let the user start from scratch:

Dim drpdwn As DropDown
Set drpdwn = ActiveSheet.DropDowns(Application.Caller)
With drpdwn
Range("b1").End(xlDown).Offset(1, 0).Value = .List(.ListIndex)
.listindex = 0
End With
End Sub

Or maybe you could supply another button near the dropdown. Have them use this
to "repeat" the value.



Joe Mathis wrote:

Hello,

The code I have below works very well to write the value chosen in the combobox to teh appropriate cell in a list. The problem I have is if the value chosen the next time I use the combobox is the same as the previous, nothing will be written. I have tried using an if/then/else to compare the previous cell to the value and using the Range statement below for true and false but it did not work. Can someone please offer some code options?

Thank you, Joe

Dim drpdwn As DropDown
Set drpdwn = ActiveSheet.DropDowns(Application.Caller)
With drpdwn
Range("b1").End(xlDown).Offset(1, 0).Value = .List(.ListIndex)
End With
End Sub


--

Dave Peterson

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
Chart content to change according to a selection on a combobox Johanna Gronlund Charts and Charting in Excel 1 February 2nd 10 02:05 PM
ComboBox Selection [email protected] uk Excel Discussion (Misc queries) 1 November 14th 08 09:38 PM
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
How do i populate a text box according to selection in combobox? Steve Excel Worksheet Functions 0 April 13th 06 12:40 PM
Sort Macro: Utilizing ComboBox Selection for Key1 through 3 Ranges buddhapenguin Excel Discussion (Misc queries) 0 May 13th 05 03:01 PM


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