+ Reply to Thread
Results 1 to 9 of 9

How to find last row with a value in column A with blanks and fill

  1. #1
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    How to find last row with a value in column A with blanks and fill

    Hello all,

    I'm back with another issue that I'm racking my brain to resolve. In the attached workbook I have a userform for data entry. Everything works on it with the exception of 1 line of code.

    The following line of code (within the 'Transfer Info if date code) does not give the desired result...
    Please Login or Register  to view this content.
    What I was expecting is that the line of code would find the last row with a value in column A and add 1 to it and place that value in the last blank row.

    Sheet1 is the result I am getting, Sheet2 is the result I was expecting.
    Sheet1 rows 6, 8 and 9 show a value of 1, 1 and 2 respectively. What I was expecting for rows 6, 8 and 9 is a value of 3, 4 and 5 respectively (Sheet3)
    Note* The yellow highlighting in the rows is just for the sample, it will not be like that for the final workbook.

    I've tried several things to get it to work, but nothing has worked for me. I'm pretty sure the issue is because the rows have "fill" in them.
    SB Workbook for Excel Forum.xlsm
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

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

    Re: How to find last row with a value in column A with blanks and fill

    How about this ?

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How to find last row with a value in column A with blanks and fill

    Props to you bakerman2!!! (Did not mean for that to rhyme)
    That worked like a charm. I should have posted this question hours ago!
    I'm going to have to find something that stumps you a bit.
    Speaking of...did you ever see question # 3 of 3?

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: How to find last row with a value in column A with blanks and fill

    try this
    Please Login or Register  to view this content.

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

    Re: How to find last row with a value in column A with blanks and fill

    Glad to help (again) and thanks for rep+.

    Yes I did but saw that Marvin already jumped in so I kinda lost track of it. How are you getting along with it ?

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How to find last row with a value in column A with blanks and fill

    You're welcome. I can't believe the solution was so easy. Nothing I looked up online was that simple at all.

    He provided an alternate solution to what I wanted, which will work, but I'd like to find the original solution I wanted so the form doesn't have to keep opening over an over again.

    @nilem - I will give your code a try and let you know how it goes.

  7. #7
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How to find last row with a value in column A with blanks and fill

    @nilem - Thank you for your code. It seems to work as I wanted and is much cleaner/shorter than the code I had.

  8. #8
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How to find last row with a value in column A with blanks and fill

    @Nilem - After the end user tested the workbook, they decided they wanted to add another column (J) to be the column that shows textbox4's value by 350. I changes the resize from 7 to 8 and added textbox7 into the array and the Val(TextBox4.Value) * 350 to the end of the array but it doesn't work. I know I'm missing something simple, just don['t know what it is.
    Here is the code with the changes I made -
    Please Login or Register  to view this content.

  9. #9
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How to find last row with a value in column A with blanks and fill

    Sorry, I had a "dit-da-duh: moment. I added column J as I said earlier, but the info was going to column H, which was hidden and I didn't notice it until just now.

+ 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. How to fill blanks between column and row
    By FloydTx in forum Excel General
    Replies: 3
    Last Post: 06-08-2017, 04:49 PM
  2. [SOLVED] VBA to loop and fill blanks with data from left column if values exist in 3 cells?
    By hopegriffin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-04-2016, 05:08 PM
  3. [SOLVED] Code to fill in blanks between entries in column
    By phbryan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2015, 09:35 AM
  4. Need to fill blanks in a column
    By bclucas55 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-16-2014, 11:27 AM
  5. [SOLVED] Macro to fill in missing blanks with data in a column
    By robertguy in forum Excel General
    Replies: 6
    Last Post: 10-19-2012, 02:49 AM
  6. Fill blanks in Column
    By LongArm in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-20-2010, 11:15 PM
  7. Copy selected cell in column and fill in blanks
    By Bluestar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2005, 10:28 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