+ Reply to Thread
Results 1 to 6 of 6

Dragging Formulas Down

  1. #1
    Forum Contributor
    Join Date
    10-04-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    161

    Dragging Formulas Down

    I have this formula that I use that works well for me. The only problem is I get this error if I only have one line and no other that need to be dragged down.

    [CODE]Range("A1:D1").AutoFill Destination:=Range("A1:D" & Cells(Rows.Count, "H").End(xlUp).Row)CODE]

    error.JPG


    Thanks in advance!!!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,042

    Re: Dragging Formulas Down

    What's the formula? What does the rest of the code look like? Can you post a sample workbook?

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-29-2014
    Location
    KC
    MS-Off Ver
    2007
    Posts
    20

    Re: Dragging Formulas Down

    If H has data in only row 1, then there are no cells in H for the code to count and then drag down for the other columns.. Add some data to some other rows in column H, then run it.

    If you have data down H, it should drag down the other columns as desired. Worked for me.

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Dragging Formulas Down

    I tested that line of code
    Please Login or Register  to view this content.
    everything is ok but the error will appear if there are no data in Column H

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,042

    Re: Dragging Formulas Down

    If you must use AutoFill, maybe this:

    Please Login or Register  to view this content.

    Regards, TMS
    Last edited by TMS; 11-12-2014 at 08:13 PM.

  6. #6
    Forum Contributor
    Join Date
    10-04-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    161

    Re: Dragging Formulas Down

    I settled with the following but TMS is correct there must be an if then

    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. [SOLVED] Dragging Down Formulas
    By mphillips in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2014, 02:00 PM
  2. Excel 2007 : Dragging formulas down
    By mkmed in forum Excel General
    Replies: 8
    Last Post: 06-15-2010, 12:33 PM
  3. Dragging formulas
    By gevo12321 in forum Excel General
    Replies: 3
    Last Post: 01-29-2010, 08:53 PM
  4. Dragging formulas
    By Thawk in forum Excel General
    Replies: 5
    Last Post: 02-11-2009, 04:29 PM
  5. [SOLVED] Dragging Formulas
    By J.D. Webster in forum Excel General
    Replies: 1
    Last Post: 02-06-2006, 05:35 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