+ Reply to Thread
Results 1 to 5 of 5

VBA to find last row in spreadsheet - THEN find first cell that contains value

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    Kent, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    3

    VBA to find last row in spreadsheet - THEN find first cell that contains value

    Hello All

    I am trying to make it simple for our shop (non-computer people) to order parts by using a userform (MachineParts) - They select a specific machine number - it populates the text boxes with part numbers, then using checkboxes, select which parts to order. This information is then stored on a worksheet (Maintenance) If a check box is checked, it stores the part number. If it is not, it stores a pre-defined "No"

    From that -

    I have a userform in rough construction (Place Order), that has mulitple text boxes (txtItem1,txtItem2,etc) that need to populate with values based off of the last row of another worksheet (Maintenance). I want to ignore the "No's" and only poplulate the text boxes with part number values. Thus - I need to find the last row (Which I can do) but need to search to the right - to the first cell with a part number value. Once the text box holds a value, I have figured out how to worksheetfunction.vlookup to find the rest of the information needed.

    Is this even possible to search for last row, then across to first, second, third etc cell that contain part number values?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA to find last row in spreadsheet - THEN find first cell that contains value

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    01-30-2013
    Location
    Kent, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: VBA to find last row in spreadsheet - THEN find first cell that contains value

    Thank you patel45!

    The code does work, it returns the last part number value on the row. This is working from right to left? Finding the last column in the row, then stepping back one cell at a time until it finds a value.

    Is there a way to search from left to right?

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA to find last row in spreadsheet - THEN find first cell that contains value

    I added comments
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-30-2013
    Location
    Kent, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: VBA to find last row in spreadsheet - THEN find first cell that contains value

    Thank You! Patel45, This is perfect. :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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