+ Reply to Thread
Results 1 to 11 of 11

ComboBox, DropDownListOnly, Range.Find Method Issue

  1. #1
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    ComboBox, DropDownListOnly, Range.Find Method Issue

    All,

    I have a userform to edit transactions in a database. I use the Range.Find Method to find the transactions to edit. This userform has many textboxes and a bunch of ComboBoxes. However there is one particular ComboBox that is giving me a headache; the ComboBox that lists years (2012 - 2030) which is pulled from a table on a spreadsheet. All my ComboBoxes are set to "Style: 2 - fmStyleDropDownList." .

    The issue I have is that when I use the Range.Find Method to load values from the database, the only field that doesn't populate with any value is.the ComboBox field with the year? However, when I set the style to fmStyleDropDownCombo, the values now show? Why is that? I can't set the style to Combo because I don't want the user to type in any random value. I want them to only select a year ex: 2014. What can I do to make this work?

    Please let me know your thoughts on this.

    Thank you!

    J

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    How are you populating the combobox?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: ComboBox, DropDownListOnly, Range.Find Method Issue

    Hi Norie,

    Please see the code below. I removed the non-essential parts.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: ComboBox, DropDownListOnly, Range.Find Method Issue

    That looks fine, how are you putting the value into the year combobox?

  5. #5
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: ComboBox, DropDownListOnly, Range.Find Method Issue

    Please see below. Again, I removed all the fluff. What do you think could be wrong with it?

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: ComboBox, DropDownListOnly, Range.Find Method Issue

    What happens if you remove On Error Resume Next?

  7. #7
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: ComboBox, DropDownListOnly, Range.Find Method Issue

    My userform doesn't load. I get a Run-time error '380': Could not set the Value property. Invalid property value.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: ComboBox, DropDownListOnly, Range.Find Method Issue

    Is that error happening in the code you posted?

    If it is it's not really what I was expecting if my thinking was right.

    What I was thinking was that Find might be failing to find idNum which would, because of the On Error..., mean byear would never get a value.

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  9. #9
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: ComboBox, DropDownListOnly, Range.Find Method Issue

    Unfortunately, I can't send the entire workbook due to the data but I just made a very simple userform (took under 5 minutes) with the issue that I have. Please see attached.
    Attached Files Attached Files

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: ComboBox, DropDownListOnly, Range.Find Method Issue

    I really can't see what the problem is but I did find a workaround, of sorts.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: ComboBox, DropDownListOnly, Range.Find Method Issue

    That worked! Thank you for your help!!!!! I will mark this as solved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using the Find method in a range from bottom to top of range
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-23-2013, 11:07 AM
  2. [SOLVED] Issue with Sorting a Range: Sort method of Range class failed
    By helpmeinexcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2013, 01:51 PM
  3. add range in find method
    By ilkamalo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2009, 03:44 AM
  4. Replies: 2
    Last Post: 01-26-2009, 07:59 PM
  5. .Find Method results issue...
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2007, 12:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1