+ Reply to Thread
Results 1 to 5 of 5

VBA Autofill Last Row in range to the last Row in adjacent Column

  1. #1
    Registered User
    Join Date
    11-20-2012
    Location
    Orlando
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA Autofill Last Row in range to the last Row in adjacent Column

    Thanks in advance.
    My Goals:

    Works so far
    1. Copy range, which is always the same: Range("AR1:BN1")
    2. Paste into the last blank Row in Column P through AL

    Can't get to work
    3. Autofill the new Pasted Range down to the last cell with Data in Column O

    The Last Blank Row in column P through AL will change
    The Rows of data will continually be added to

    The VBA I have so far for 1 and 2 is below. I have tried multiple different methods on these forums, which all seem very close, but just won't work for my changing data.
    I commented the last 2 rows because they were diving me errors, but that's as close as I've gotten so far.


    Please Login or Register  to view this content.

    Again, Thanks you so much!
    Attached Files Attached Files
    Last edited by AliGW; 06-20-2021 at 05:10 AM.

  2. #2
    Registered User
    Join Date
    03-10-2021
    Location
    Paryzevo
    MS-Off Ver
    2k3
    Posts
    60

    Re: VBA Autofill Last Row in range to the last Row in adjacent Column


    What do you want to copy from "AR1:BN1" to "P:AL" columns ?
    You have formulas in both "ranges".
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-20-2012
    Location
    Orlando
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VBA Autofill Last Row in range to the last Row in adjacent Column

    Thank you so much for your time.

    I want to copy the formulas from "AR1:BN1" to "P:AL" columns.
    Your code only copied the values to P and Q and it didn't stop at the last row in O.

    This code actually worked last night. It didn't use autofill, but it worked for me.
    What worked:

    Please Login or Register  to view this content.
    Last edited by AliGW; 06-20-2021 at 05:11 AM.

  4. #4
    Registered User
    Join Date
    03-10-2021
    Location
    Paryzevo
    MS-Off Ver
    2k3
    Posts
    60

    Re: VBA Autofill Last Row in range to the last Row in adjacent Column

    Quote Originally Posted by [email protected] View Post
    ... I want to copy the formulas ...
    Instead of "Value":
    Please Login or Register  to view this content.
    enter "Formula":
    Please Login or Register  to view this content.
    Quote Originally Posted by [email protected] View Post
    ... it didn't stop at the last row in O ...
    This is because you have a great cosmic hole between rows 35 and 5286 in your "xls" example:
    Attached Images Attached Images

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,438

    Re: VBA Autofill Last Row in range to the last Row in adjacent Column

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new here, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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 autofill formula row down to other rows where adjacent column is populated
    By jamesr86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2016, 02:03 AM
  2. VBA Macro to autofill data in column based on value on adjacent cell
    By cazantheman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2013, 02:04 PM
  3. [SOLVED] Autofill Upwards With Reference to Adjacent Column
    By picton2000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2013, 04:12 PM
  4. [SOLVED] Macro to autofill formula down to length of adjacent column to the left
    By jacobadger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2012, 08:28 PM
  5. [SOLVED] VBA Code Required to autofill formulated column according to the adjacent column
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-30-2012, 12:05 PM
  6. Autofill a column based on number in adjacent column
    By fbonetti in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-08-2011, 04:19 PM
  7. autoFill column equal to adjacent column
    By Paulg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2006, 08:04 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