Results 1 to 7 of 7

Run-Time error 1004 when trying to run Macro

Threaded View

  1. #1
    Registered User
    Join Date
    02-06-2014
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    25

    Run-Time error 1004 when trying to run Macro

    Hi all, I'm getting the error 1004 whilst running this macro. It was working fine earlier, any advice would be much appreciated.

    
    Sub DateFormat()
    
    ' converts dates from dd.mm.yy format to dd/mm/yy format
    
    Dim LastRow As Integer
    
     jLastRow = Sheets("Data").UsedRange.Rows.Count
     
        Columns("J:J").Select
        
        Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
        Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
        
        Range("J1").Select
        ActiveCell.FormulaR1C1 = "=REPLACE(RC[-1],3,1,""/"")"
        Selection.AutoFill Destination:=Range(Cells(1, 10), Cells(jLastRow, 10))
        
        Range("K1").Select
        ActiveCell.FormulaR1C1 = "=REPLACE(RC[-1],6,1,""/"")"
        Selection.AutoFill Destination:=Range(Cells(1, 11), Cells(jLastRow, 11))
    
    Call GetDays
    
    End Sub

    The error occurs on the line: "Selection.AutoFill Destination:=Range(Cells(1, 10), Cells(jLastRow, 10))"




    Thanks,

    Matt
    Last edited by Matt2014; 03-31-2014 at 06:55 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel Macro Error - Run time error 1004 - Paste method of worksheet class failed
    By kvflynn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2012, 10:51 AM
  2. Macro Run-time error '1004':
    By Kody_Devl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-24-2012, 03:09 PM
  3. Run-time error '1004': Macro error, only when shared
    By Pergo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2011, 12:57 PM
  4. Excel 2007 : Macro run-time error 1004
    By tuph in forum Excel General
    Replies: 4
    Last Post: 11-23-2009, 07:04 PM
  5. [SOLVED] MACRO Run Time Error 1004
    By The Toasterman in forum Excel General
    Replies: 1
    Last Post: 06-30-2006, 11:25 AM

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