Solved

Excel Fill Down VBA Not Working

Posted on 2014-12-01
2
231 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
Comment Utility
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
Comment Utility
Thanks. Such a silly typo to miss!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
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…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now