+ Reply to Thread
Results 1 to 5 of 5

Use autofill in vba to get the last row (run time error)

  1. #1
    Forum Contributor
    Join Date
    01-31-2017
    Location
    England
    MS-Off Ver
    13
    Posts
    102

    Use autofill in vba to get the last row (run time error)

    HI Experts,

    I'm hoping to select cells A3:B3 and fill to the last row. Column C has data in it, but the last row varies for the count. The below code is my attempt at trying to get this to work, but I end up with a runtime error 1004.

    Please Login or Register  to view this content.

    Thankyou.

  2. #2
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Use autofill in vba to get the last row (run time error)

    Try...

    Please Login or Register  to view this content.
    although there is no point using a with statement with the activesheet so just...
    Please Login or Register  to view this content.
    For both codes
    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    if you mean column C is your longest column with data.

    in your statement
    Column C has data in it, but the last row varies for the count
    Last edited by WasWodge; 02-24-2019 at 09:51 AM.
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  3. #3
    Forum Contributor
    Join Date
    01-31-2017
    Location
    England
    MS-Off Ver
    13
    Posts
    102

    Re: Use autofill in vba to get the last row (run time error)

    thanks for the advice and response.

  4. #4
    Forum Contributor
    Join Date
    01-31-2017
    Location
    England
    MS-Off Ver
    13
    Posts
    102

    Re: Use autofill in vba to get the last row (run time error)

    Yes, column c has the longest column with data. I'll give these suggestions a try. thank you.

  5. #5
    Forum Contributor
    Join Date
    01-31-2017
    Location
    England
    MS-Off Ver
    13
    Posts
    102

    Re: Use autofill in vba to get the last row (run time error)

    Thank you for the response. apologies for the very tardy reply here. your suggestions were helpful so thankyou.

+ 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 date and time for different time zones
    By brofessional in forum Excel General
    Replies: 0
    Last Post: 12-06-2013, 02:13 PM
  2. [SOLVED] Autofill error
    By dleslieca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2013, 12:57 PM
  3. Cannot Publish Excel Pivot Chart - Run Time Error
    By crisb184 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2013, 07:04 AM
  4. Run-time error '1004' - Autofill method of range class failed
    By zhout2 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-26-2013, 01:47 PM
  5. Run-Time Error '1004' AutoFill method of Range class Failed
    By RS944 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2013, 11:37 AM
  6. run-time error ;2147023179 (800706b5) time automation error interface unknown
    By karthik72 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-02-2012, 09:31 AM
  7. Run time error '1004' Autofill method of Range class failed
    By lanie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2009, 08:30 AM
  8. Trying to autofill to end and getting run time error
    By ugg in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-29-2007, 10:21 PM

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