+ Reply to Thread
Results 1 to 10 of 10

Change cells in row based on row of Combobox selection

  1. #1
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Change cells in row based on row of Combobox selection

    Good morning,

    Can anyone see what is wrong with my code? I am using the name identified in the combobox (cmbPS) to identify the row and then change the resulting cells. I keep getting an application defined or object defined error highlighting the row marked
    Please Login or Register  to view this content.
    The entire code:

    Please Login or Register  to view this content.
    Thanks

    M

  2. #2
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Change cells in row based on row of Combobox selection

    Any ideas?

  3. #3
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Change cells in row based on row of Combobox selection

    PArtially fixed using the following code:

    Please Login or Register  to view this content.
    Problem now is that it's updating the right columns but the wrong rows. Is my cmbPSListIndex + 7 incorrect in defining the row of the selected value from the combobox (the list starts 7 rows down on the spreadsheet)?

  4. #4
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Change cells in row based on row of Combobox selection

    Any ideas?

  5. #5
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    863

    Re: Change cells in row based on row of Combobox selection

    Hi ! Can't you upload a sample file? (after striping off the sensible data)
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  6. #6
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Change cells in row based on row of Combobox selection

    Sorry I can't post the file, I think it has something to do with this line being incorrect:

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    863

    Re: Change cells in row based on row of Combobox selection

    there is a dot missing there...
    if that is the error it should be
    Please Login or Register  to view this content.
    if not, try to find the cmbPS.ListIndex value
    put a msgbox cmbPS.ListIndex before that line. (debug.print cmbPS.ListIndex works also if you have the Immediate Window enabled (Ctrl+G)

  8. #8
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Change cells in row based on row of Combobox selection

    OK I fixed that but for some reason it's still changing the incorrect rows.

  9. #9
    Forum Contributor
    Join Date
    08-13-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    209

    Re: Change cells in row based on row of Combobox selection

    Ok I pinpointed the issue, it's because cmBPS is creating unique values from PSList which has duplicate entries:

    Please Login or Register  to view this content.
    As a result, cmbPS.ListIndex is not equal to PSList.ListIndex

    How should I go about fixing this?

  10. #10
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    863

    Re: Change cells in row based on row of Combobox selection

    i have no ideea untill i see the entire code BUT you can try :
    Please Login or Register  to view this content.

+ 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. Change Userform fields based on combobox selection
    By vikrampnz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2014, 06:57 AM
  2. Change Userform Label based on ComboBox Selection
    By rbyrd023 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-02-2014, 09:25 AM
  3. [SOLVED] Change Labels in Userform based on selection in ComboBox
    By johnw993 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-03-2013, 10:52 PM
  4. Change label captions based on combobox selection
    By alter54 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-07-2012, 06:02 PM
  5. [SOLVED] Change Worksheet based on ComboBox selection
    By dagindi in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-15-2012, 10:19 AM

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