+ Reply to Thread
Results 1 to 5 of 5

Userform Code to Find entered value and replace with specific text

  1. #1
    Registered User
    Join Date
    07-14-2019
    Location
    Seattle, WA
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Userform Code to Find entered value and replace with specific text

    Hello everyone,

    To start, I've looked far and wide for a specific solution to this, so I apologize if this ends up being redundant to another thread.

    I currently have a code written for a userform with dynamic dependent combo boxes the user picks from in order to identify a specific part number they would like to remove from a bill of materials.

    When the user clicks submit, once all fields are filled out, the code below logs the part number (cmb_RemovePN) and quantity (tb_RemoveQTY) to a removal log on (sheet 2).

    Userform.JPG

    Please Login or Register  to view this content.

    What I am trying to do is add to my userform VBA code so that when I click the submit button, excel finds the value chosen in the part number combo box (cmb_RemovePN) in range (sheet 8, column "F") and changes the matching part number in that location to the word "Replaced".

    I've been able to find examples of how to do this via setting up a find value & replace value table, or by setting specific find and replace values in the code itself, but in my entry each part number entered will be different, while the replacement word "replaced" will remain the same.

    The data that my dependent drop-down boxes uses is a match to the part numbers shown on the sheet I want to update, so there won't be an instance of "no part number found.

    This is my first post, so please just let me know what else you need from me. Your help is greatly appreciated.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Userform Code to Find entered value and replace with specific text

    Hello NWguy,

    Welcome to the forum!

    It would be best if you attach a copy of your workbook.
    1. Click on GO ADVANCED at the bottom of the message window.
    2. Once the new window opens, scroll down to the section Additional Options.
    3. You will see the heading Manage Attachments. Click on the link Manage Attachments
    4. Under the heading Upload Files from your Computer, click the button on the top left Choose File
    5. Once the you have selected your file, click the Upload button on the far right side.
    6. After the file has finished uploading, click the button on the top left side Close this window.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    07-14-2019
    Location
    Seattle, WA
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: Userform Code to Find entered value and replace with specific text

    Unfortunately my workbook contains sensitive data that I cannot share. I can create a dummy workbook to show my intent if necessary, but I was hoping to gain a little bit of direction first without it.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Userform Code to Find entered value and replace with specific text

    Hello NWguy,

    A dummy workbook is fine just as long as it faithfully reproduces the original layout, formatting, formulas, and any macros it uses. The reason I am asking for all of this is when comparing and searching for information, there a myriad number of issues that interfere with the processes. Rather than play Q and A ping pong and hope we get it right, having accurate data from the outset will save time. Thanks.

  5. #5
    Registered User
    Join Date
    07-14-2019
    Location
    Seattle, WA
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: Userform Code to Find entered value and replace with specific text

    Dummy workbook uploaded. The button that activates the userform in question is titled "remove part" at the top of Sheet 1.

    Sheet 1 is the log for all remove entries. Columns A & B are updated when the submit button in the userform is selected.

    Sheet 4 is the data to populate and restrict the dependent drop down boxes of the userform

    Sheet 2 is the bill of materials I am searching in column "F" for a match to cmb_removePN combo box value, and to change the part number in column F on sheet 2 to the word "removed"

    Note* the userform won't open upon clicking the "remove part" button on Sheet 1, however a screenshot of that userform is shown in my original post.

    Hopefully this is enough to get started. Thanks All.
    Attached Files Attached Files

+ 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. Find a lowest price for the specific SKU entered in to the text field.
    By sigitasl in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-12-2019, 07:41 AM
  2. Find Replace specific Text on criteria
    By sanjuss2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2017, 03:37 AM
  3. Find and replace first slash after specific text string
    By MarlboroMan in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 08-23-2017, 12:00 PM
  4. [SOLVED] Vba code to find and replace using userform.
    By UPA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2017, 12:03 AM
  5. [SOLVED] Search through columns and find specific text and replace that text with header column
    By adamzee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2014, 11:59 PM
  6. use macro to find and replace specific code in vba
    By hopefulhart in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2014, 09:46 AM
  7. Code to Find and Replace Userform Values
    By ZEvans12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2011, 10:57 AM

Tags for this Thread

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