LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Autofill Error

Hi

I am trying to use the below code to add a calculated field to a report I am
working on. Unfortunately an error is trigered on the autofill line. I am not
sure what causes this but if in break mode i go into the sheet and select the
cell and then run the code again it seems to work.

Does anyone know why this happens?

TIA

Sub ZPOHeader()
Dim iLRowHeader As Integer

iLRowHeader = Sheets("ZPOHeader").Cells(Rows.Count, 1).End(xlUp).Offset(1,
0).Row - 1

'Update currency in ZPOHeader
With Sheets("ZPOHeader")
..Range("N1").Value = "Eur Amount"
..Range("N2").Formula = "=M2*VLOOKUP(I2,Xrates!$A$2:$B$8,2,0)"
..Range("N2").AutoFill Destination:=Range("N2:N" & iLRowHeader)
..Columns(14).NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(*
""-""??_);_(@_)"
End With

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 10 April 16th 09 09:06 PM
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 3 April 14th 09 10:35 PM
Autofill & On Error Resume Next Dandelo Excel Discussion (Misc queries) 2 August 21st 08 07:14 PM
Q. Autofill question: Can I autofill alpha characters like I can numbers? George[_22_] Excel Programming 5 August 7th 04 10:33 AM
autofill macro has error when there is nothing to fill. RichardO[_9_] Excel Programming 2 June 9th 04 05:31 AM


All times are GMT +1. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"