Solved

Excel Fill Down VBA Not Working

Posted on 2014-12-01
2
273 Views
Last Modified: 2014-12-01
Hi,

Below is a section of code. Line 10 is giving the following error.
Runtime error 1004:
AutoFill method of Range class failed


Sub mac_fullmacro()
'
' mac_copyrawdata Macro

Dim uniquerow As Long
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Exported_Data")
    RowCount = ws.Range("A" & Rows.Count).End(xlUp).Row

Range("I2").AutoFill Destination:=Range("I2:L" & RowCount), Type:=xlFillSeries
Range("L2").AutoFill Destination:=Range("L2:L" & RowCount), Type:=xlFillSeries
Range("M2").AutoFill Destination:=Range("M2:M" & RowCount), Type:=xlFillSeries
Range("N2").AutoFill Destination:=Range("N2:N" & RowCount), Type:=xlFillSeries
Range("O2").AutoFill Destination:=Range("O2:O" & RowCount), Type:=xlFillSeries
Range("P2").AutoFill Destination:=Range("O2:O" & RowCount), Type:=xlFillSeries

End Sub

Open in new window


Can you help?
0
Comment
Question by:dabug80
2 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40473411
Line 10 has "I2:L" - it should read "I2:I"
Line 15 has "O2:O" - it should read "P2:P"
0
 
LVL 1

Author Closing Comment

by:dabug80
ID: 40473436
Thanks. Such a silly typo to miss!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question