+ Reply to Thread
Results 1 to 5 of 5

Autofill.... erg!!!

Hybrid View

  1. #1
    Registered User
    Join Date
    07-17-2014
    Location
    Edmonton
    MS-Off Ver
    2010
    Posts
    29

    Autofill.... erg!!!

    what is wrong with this?? Errors out at the autofill...

    CurrentWB.Worksheets("Data Processing").Range("I2").Formula = "=IF(D2=0,IF(E2=0,"",E2),D2)
        With CurrentWB.Worksheets("Data Processing").Range("I2")
            .AutoFill Destination:=Range("i2:i" & LastRow)
        End With
    Have tried this:

    CurrentWB.Worksheets("Data Processing").Range("I2").Formula = "=IF(D2=0,IF(E2=0,"",E2),D2)"
    CurrentWB.Worksheets("Data Processing").Range("I2").Copy
    CurrentWB.Worksheets("Data Processing").Range("I2").Range(Cells(2, 2), Cells(Endrow, 2)).PasteSpecial (xlPasteFormulas)
    and this:

        With Worksheets("Data Processing")
         .Range("i2:i10").Formula = "=IF(D2=0,IF(E2=0,"",E2),D2)"
         .Select
         .AutoFill Destination:=Range("K4:K" & LastRow), Type:=xlFillDefault
        End With
    Incredibly frustrating as I am sure it is something stupid.... we all have our moments....

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Autofill.... erg!!!

    Assuming lastrow is correctly valued,

        With CurrentWB.Worksheets("Data Processing")
            .Range("I2", .Cells(lastrow, "I")).Formula = "=IF(D2=0,IF(E2=0,"""",E2),D2)"
        End With
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Autofill.... erg!!!

    <duplicate post>

  4. #4
    Registered User
    Join Date
    07-17-2014
    Location
    Edmonton
    MS-Off Ver
    2010
    Posts
    29

    Re: Autofill.... erg!!!

    STUPID quadruple quotes!!! Thanks, should have saw that!

    Thanks,

    david

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Autofill.... erg!!!

    You're welcome.

+ 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 base on Active Cell and Autofill by row count of another sheet
    By enyak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-19-2014, 10:06 PM
  2. [SOLVED] Very small AutoFill macro showing "AutoFill methode of range class failed" why ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2013, 10:21 PM
  3. 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
  4. Replies: 1
    Last Post: 06-17-2005, 04:05 PM
  5. Replies: 0
    Last Post: 03-02-2005, 12:06 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