+ Reply to Thread
Results 1 to 23 of 23

Autofill Vlookup/Formula to last row in multi range and option button

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Autofill Vlookup/Formula to last row in multi range and option button

    Greatly appreciate for helping me with below:

    1. I have Vlookup and formula from Range "B1:AM1". How can I autofill those to the last row depends on data of column A:A (Exp: if the last data on column A:A is A599 so autofill all Vlookup/Formula from B1:AM1 to range "B599:AM599").

    2. a_I have GroupBox (Car) includes: two Option Buttons (Yes & No).
    b_CarUserForm includes: three labels (Model, Year, Insurance); three textBox for each label; two CommandButton (OK & Cancel)
    When I click Yes (CarUserForm popup) let people enter info into three TextBox and hit OK (value appears on Range in order A1, A2, A3). If any TextBox info is missing so MsgBox "Please enter Model" or "Please enter Year" or "Please enter Insurance" popup (depends on which TextBox info is missing) and CarUserForm still open to let people re-enter info.
    If people hit Cancel to Unload CarUserForm then Option Buttons automatic change form Yes to No.

    Thank you very much for all your help
    tt3

    Hi AB33 & HSV,
    Thank you very much for your quick help but please take a look at my files sample and show me the code.

    Best regards,
    tt3
    Last edited by tuongtu3; 11-05-2012 at 02:04 AM. Reason: Solved

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    I do not know how your formula looks, but these line might give you to loop through until the last row

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Or:
    Please Login or Register  to view this content.
    Harry.

  5. #5
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    @ AB33

    Hi,
    I tried with your code but it didn't autofill to last row. Not sure what I did wrong.

    Thank you for your help. Please look at sample file in the attached and help me out.

    tt3
    Last edited by Cutter; 10-29-2012 at 09:36 PM. Reason: Removed whole post quote

  6. #6
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    @ HSV

    Hi Harry,
    Thank you for your help but I don't know how to use your code because I'm a beginner. Can you look at the sample file in the attached and give me some code.

    Regards,
    tt3
    Last edited by Cutter; 10-29-2012 at 09:36 PM. Reason: Removed whole post quote

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    tt3,
    The description of the problem you have does not match with the data you supplied. I do not know what you meant by Range B:AM as you only have formulas in column D and E. As per your instructions which are found in yellow and green colours, here is s simple code. All the code does is to fill in columns D and E until the last row as long as column A is not empty.

    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    I put some formulas in row 1 (B1 to AM1)
    The most formulas don't work, but that's irrelevant.
    Run code hsv()
    Alt+F8 → Run.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Hi Harry,
    That's awsome but please look at filesample in attached (this is difference) and advise with code how to run. Can you help me with other code (Car_OptionButton)

    Regards,
    tt3
    Last edited by Cutter; 10-29-2012 at 09:37 PM. Reason: Removed whole post quote

  10. #10
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Hi AB33,
    That's working perfect with the filesample but please look at filesample in attached (this is difference) and advise. Can you help me with other code (Car_OptionButton)

    Regards,
    tt3
    Last edited by Cutter; 10-29-2012 at 09:37 PM. Reason: Removed whole post quote

  11. #11
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    What result did you expect @tt3.

  12. #12
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Quote Originally Posted by HSV View Post
    What result did you expect @tt3.
    Your code is eactacly what I expect but now I want result start from Range E18:AM18 instead with column A is blank (that mean autofill to the last row of data on column B). I also don't want to show formula on the result sheet.

    Regards,
    tt3

  13. #13
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    There must be a formula in range ("H18:AM18").

    Try it once.
    Ps.
    The code is in the example.
    Also the code below works if you will put de data from range B1:B7 in range A1:A7.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by HSV; 10-29-2012 at 07:09 PM. Reason: Ps.

  14. #14
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Harry,
    I suspect what the OP is after is to automatically fill in the range B:BM. OP has formual in Column B-D, so all the remaining columns need to be filled in auto.OP would put data in Columns A and B(With green highlighted) and columns B-BM will auto fill in. IMO, to do this, you need to use look up formula included in the code. I do not think the OP wantes to put any formula with range B-BM.

  15. #15
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Autofill hsv.xlsm
    Quote Originally Posted by AB33 View Post
    Harry,
    I suspect what the OP is after is to automatically fill in the range B:BM. OP has formual in Column B-D, so all the remaining columns need to be filled in auto.OP would put data in Columns A and B(With green highlighted) and columns B-BM will auto fill in. IMO, to do this, you need to use look up formula included in the code. I do not think the OP wantes to put any formula with range B-BM.
    Hi AB33/Harry,
    The code(s) work perfect as I expect and thank you very much for all of you help. I've attached a sample file again with questions and please take a look from Sheet1 - Sheet5 when you have time.
    Thank you very much again.

    tt3

  16. #16
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    @tt3,

    Please Login or Register  to view this content.
    Clear Range("B1:B7"), and code hsvtwo() runs perfect too.
    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    [QUOTE=HSV;2988670]@tt3,

    Please Login or Register  to view this content.
    Hi HSV/AB33,

    The code is perfect and thanh you very much for all your help. How can I make it limit to 1000 rows because my worksheet only run up to rows 1000 then pop up a msgbox "You have reach over limit of 1000 line".

    Regards,
    tt3
    Last edited by tuongtu3; 11-03-2012 at 02:09 AM.

  18. #18
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    @tt3,

    Something.
    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Quote Originally Posted by HSV View Post
    @tt3,

    Something.
    Please Login or Register  to view this content.
    Hi Harry,
    The code is perpect but I came up with an idea is when I have a data of 2999 lines then how to autofill up to limit 1000 lines and then continue autofill from 1001 to 2001 then continue autofill from 2001 to 2999. Would you please help me with this.

    Thank your for your help.
    Regards,
    tt3

  20. #20
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    The formulas are converted to values.
    Please Login or Register  to view this content.
    How you had it your self proposed?

  21. #21
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Quote Originally Posted by HSV View Post
    The formulas are converted to values.
    Please Login or Register  to view this content.
    How you had it your self proposed?
    Would you please show me where to insert this code into the original code.

    Regards,
    tt3

  22. #22
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Quote Originally Posted by HSV View Post
    @tt3,

    Something.
    Please Login or Register  to view this content.
    Hello tt3,

    If you run the code, the formulas will be values.
    You can't continue autofill to 2000 if there are no formulas in row 18.

  23. #23
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    818

    Re: Autofill Vlookup/Formula to last row in multi range and option button

    Quote Originally Posted by HSV View Post
    Hello tt3,

    If you run the code, the formulas will be values.
    You can't continue autofill to 2000 if there are no formulas in row 18.
    Hi HSV,
    Sorry for the late reply. It took me about a day to figured it out how to make your code works because I don't have "Option Explicit" statement at the top of a code module.
    Thank you again for your time and help.

    Regards,
    tt3

+ 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