+ Reply to Thread
Results 1 to 10 of 10

Insert data to last row of a range- VBA

  1. #1
    Registered User
    Join Date
    04-20-2022
    Location
    Chicago, Illinois
    MS-Off Ver
    2020
    Posts
    7

    Question Insert data to last row of a range- VBA

    Hello,

    I am writing a code that prompts a user with an input box and then inserts this data into the last row of a defined range. I am having trouble finding the correct code to insert this data into the last row of my selected range.

    Many similar topics show how to select the last row in an active range but I have been unable to find very much information regarding the last row of a selected range. The range I hope to select is not the last piece of data in the worksheet so XL (up) has been unsuccessful for me so far.

    In other words, I am attempting to insert User defined variables A,B,& C into the next empty row of the three column range B5:D15.

    Any information would be very helpful!

    Thank you!

    (This question has not been cross posted)
    Last edited by vhoffman; 04-21-2022 at 02:58 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Insert data to last row of a range- VBA

    dim the selected range as an array & write a for loop to find an empty row.

    if you post your workbook, I will write you the code.

  3. #3
    Registered User
    Join Date
    04-20-2022
    Location
    Chicago, Illinois
    MS-Off Ver
    2020
    Posts
    7

    Re: Insert data to last row of a range- VBA

    thank you for the help, here is my workbook file with sensitive data removed.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-20-2022
    Location
    Chicago, Illinois
    MS-Off Ver
    2020
    Posts
    7

    Re: Insert data to last row of a range- VBA

    Thank you, I have posted a workbook sample!

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Insert data to last row of a range- VBA

    Is this a possible start?
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-20-2022
    Location
    Chicago, Illinois
    MS-Off Ver
    2020
    Posts
    7

    Re: Insert data to last row of a range- VBA

    Thank you! I'm pretty unfamiliar with coding VBA but every bit of information helps!

  7. #7
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Insert data to last row of a range- VBA

    Give this a whirl...
    Please Login or Register  to view this content.
    if I helped you, please give me some flair

  8. #8
    Registered User
    Join Date
    04-20-2022
    Location
    Chicago, Illinois
    MS-Off Ver
    2020
    Posts
    7

    Re: Insert data to last row of a range- VBA

    Thank you so much! Exactly what I was looking for, I appreciate it very much!

  9. #9
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Insert data to last row of a range- VBA

    Quote Originally Posted by vhoffman View Post
    Thank you so much! Exactly what I was looking for, I appreciate it very much!
    Awesome, glad it worked! If you run into any problems, I'll help you out :D

  10. #10
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Insert data to last row of a range- VBA

    Here I mistakenly thought that you would select a range as you mentioned in your first post.
    If you want hard code the values. (unlikely)
    Please Login or Register  to view this content.
    If your values are below each other (here in G1 to G3)
    Please Login or Register  to view this content.
    If your values are beside each other (here G1 to I1)
    Please Login or Register  to view this content.

+ 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. USERFORM insert data in range
    By TommyBabb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2019, 10:49 AM
  2. [SOLVED] Insert Xnumber (X=A1) of rows between data in a table& copy data from a range to new cells
    By blue_clouds_mountain in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-09-2019, 12:47 PM
  3. [SOLVED] Insert row and data into range
    By jewellove in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2014, 10:53 PM
  4. Choose max vlaue in a range and insert data
    By jazbath in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2013, 06:00 PM
  5. [SOLVED] Insert new row at bottom of data range
    By Shaun Gemiver in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2013, 12:30 PM
  6. Insert new columns into data range!
    By dbolan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-01-2007, 01:27 PM
  7. [SOLVED] insert entire row for new data, external data range doesnt work
    By orlya1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2006, 03:45 PM

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