+ Reply to Thread
Results 1 to 8 of 8

Trouble w/ Autofill in recorded macro

  1. #1
    Registered User
    Join Date
    02-22-2019
    Location
    St.Paul
    MS-Off Ver
    Office16
    Posts
    6

    Trouble w/ Autofill in recorded macro

    Hello,

    I've recorded a code, a portion of my record utilizes the autofill function when I double click the '+' in the bottom right hand corner of the cell. This autofills the data all the way until the left adjacent data ends. The problem is the the recorded macro utilizes a specific number of rows to autofill, rather than dynamically changing the autofill to fit the data.

    Here's the portion of the code, of which occurs multiple times through my recorded macro:

    Please Login or Register  to view this content.
    Notice how this will only autofill through E108, but I want it to change less/more depending on the adjacent data to the left. Any help will be greatly appreciated

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Trouble w/ Autofill in recorded macro

    Good afternoon throwaway321

    This question seems remarkably similar to this question which has a working answer that you haven't bothered to respond to.

    If this question is different in some way (and I don't think it is, but I shall leave it unlocked for now) then you might like to offer a word of thanks to YasserKhalil for his time in answering your last question and explain why it didn't work out for you.

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Trouble w/ Autofill in recorded macro

    Try:
    Please Login or Register  to view this content.
    This will adjust based on the last row with data in column D.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Registered User
    Join Date
    02-22-2019
    Location
    St.Paul
    MS-Off Ver
    Office16
    Posts
    6

    Re: Trouble w/ Autofill in recorded macro

    Oh I hadn't noticed I got a response on the thread; I figured I'd update w/ a new more specific post. I will go test his response and add reputation accordingly.

    thank you!

  5. #5
    Registered User
    Join Date
    02-22-2019
    Location
    St.Paul
    MS-Off Ver
    Office16
    Posts
    6

    Re: Trouble w/ Autofill in recorded macro

    Thanks Mumps1! I believe your solution has worked. However now as i'm skimming through my code, I believe a have another similar problem but this time It's with the remove duplicate function.

    The code I have now:
    Please Login or Register  to view this content.
    Again this is another problem w/ my recording, as it only records a specific cell rather than a dynamic range.Starting in column P, the data is sorted in a way that blanks come first, followed by the data. What i'm trying to simulate is Ctrl+Down in column P to go the first cell w/ data after the blanks, then Ctrl Shift Left and Ctrl Shift Down to select all the data from that point on, then finally remove duplicates.

    Thanks again for your help

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Trouble w/ Autofill in recorded macro

    Try:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-22-2019
    Location
    St.Paul
    MS-Off Ver
    Office16
    Posts
    6

    Re: Trouble w/ Autofill in recorded macro

    Does it matter where I enter this into my code?

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Trouble w/ Autofill in recorded macro

    It depends on what the rest of you code is doing. The macro finds the first and last rows with data in column P and then uses those cells to define the range on which to remove the duplicates based on column P.

+ 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. Autofill Range "stuck" In Recorded Macro
    By Cancat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2016, 04:32 PM
  2. [SOLVED] Recorded macro doing more than recorded?
    By Trending in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2014, 11:42 AM
  3. [SOLVED] Recorded Pivot Table Macro Doesn't Do What I Recorded!
    By diakonos1984 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2013, 11:01 AM
  4. [SOLVED] excel 2007 chart macro graphs data only from sheet on which macro was recorded
    By JW1028 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2013, 06:33 PM
  5. Macro for Autofill removes header info when there is no data to autofill
    By esturan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2012, 01:42 PM
  6. Trouble with autofill of named range
    By ccolton in forum Excel General
    Replies: 5
    Last Post: 02-06-2012, 12:05 PM
  7. [SOLVED] autofill with variables trouble
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2006, 05:50 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