+ Reply to Thread
Results 1 to 5 of 5

Find a value in a column and then fill some cells in that row. Everything using InputBox

  1. #1
    Registered User
    Join Date
    04-22-2016
    Location
    Colombia
    MS-Off Ver
    2013
    Posts
    3

    Find a value in a column and then fill some cells in that row. Everything using InputBox

    Hello Excelforum, excuse me if I make a mistake with the language because English is not my own.

    I want to press a command button in sheet A that pops an inputbox asking for a value. That value is then searched in the column A of the sheet B.

    If the value doesn't exist, it should appear a message box saying something like "sorry, it doesn't exist" and exit sub. But if the value exists in that column, then pop up a new input box, asking for a new value, that will appear in the J column of the same row of the value, everything in sheet B.

    Finally, new inputboxes will appear until column M, doing the same thing. When finishes, appear a messagebox saying something like "You're done, great!"

    And finishes sub

    Thank you a lot guys

  2. #2
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Find a value in a column and then fill some cells in that row. Everything using InputB

    Hi Antoniozarzal,

    Here is code that can be assigned to a button that searches and updates data in a sheet named "B" per your description.

    Please Login or Register  to view this content.
    Hope that helps,

    Dan

  3. #3
    Registered User
    Join Date
    04-22-2016
    Location
    Colombia
    MS-Off Ver
    2013
    Posts
    3

    Re: Find a value in a column and then fill some cells in that row. Everything using InputB

    Hi Dan, your code worked awesome, I made some little changes and that was great. Thank you a lot!

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,610

    Re: Find a value in a column and then fill some cells in that row. Everything using InputB

    @ djbomaha

    Use Application.Match instead of Worksheetfunction.Match. In case of error code doesn't go into debug and you don't need that entire error-routine.
    Just check value of variable is enough to choose how to proceed.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Find a value in a column and then fill some cells in that row. Everything using InputB

    Hi bakerman2,

    Thanks for the guidance. It will help me streamline my programming a little bit more. Your suggestion on how to use error handling definitely makes the code more efficient and not as confusing without the "else" statement mine required.

    Thanks,

    Dan

+ 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. VBA to find/fill column based on date
    By superdrno in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2016, 12:28 PM
  2. Replies: 3
    Last Post: 09-23-2015, 02:30 PM
  3. Replies: 3
    Last Post: 05-28-2014, 12:01 PM
  4. Fill out listbox with inputbox
    By sebastienkanj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2013, 10:27 AM
  5. Find Blank cell in column then Fill Up
    By klassic in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-28-2012, 02:39 AM
  6. Replies: 1
    Last Post: 09-07-2011, 05:57 PM
  7. Find Last row and fill the cells
    By dadamdreams in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2009, 10:11 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