Solved

Excel Fill Down VBA Not Working

Posted on 2014-12-01
2
373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

624 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