Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default Run-time error '1004': AutoFill method of Range class failed

Hello:

I wrote a macro that while being recorded returned the correct values, but
when I try to run it I'll get the run-time error '1004'.
Here is the excerpt from the macro that I'm trying to loop to run on
multiple worksheets of the workbook.

ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R3C1,'[ATF master file.xls]Orders OP'!R3C4:R55C15,2,FALSE)"
Selection.AutoFill Destination:=Range("C9:C16"), Type:=xlFillDefault
Range("C9:C16").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With

The problematic row is the one starting with "Selection.AutoFill"....
I'm pretty new to macros so although I can record a simple one, I'm unable
to correct it.

Please help.
Thank you.

Monika
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 248
Default Run-time error '1004': AutoFill method of Range class failed

I have added ActiveCell.Select to the macro shared by you..
assuming you want to copy the formula in A1 to C9:C16
Try
Sub t()
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R3C1,Sheet2!R3C4:R55C15,2,FALSE)"
ActiveCell.Select
Selection.AutoFill Destination:=Range("C9:C16"), Type:=xlFillDefault
Range("C9:C16").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone

End Sub
--
Pl click the YES button
(if you see it - don''''''''t worry if you don''t),
if this answer was helpful.



"murkaboris" wrote:

Hello:

I wrote a macro that while being recorded returned the correct values, but
when I try to run it I'll get the run-time error '1004'.
Here is the excerpt from the macro that I'm trying to loop to run on
multiple worksheets of the workbook.

ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R3C1,'[ATF master file.xls]Orders OP'!R3C4:R55C15,2,FALSE)"
Selection.AutoFill Destination:=Range("C9:C16"), Type:=xlFillDefault
Range("C9:C16").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With

The problematic row is the one starting with "Selection.AutoFill"....
I'm pretty new to macros so although I can record a simple one, I'm unable
to correct it.

Please help.
Thank you.

Monika

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default Run-time error '1004': AutoFill method of Range class failed

Hello Sheeloo:

I've replaced your section into my macro and still getting the same error.
Thanks

Monika

"Sheeloo" wrote:

I have added ActiveCell.Select to the macro shared by you..
assuming you want to copy the formula in A1 to C9:C16
Try
Sub t()
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R3C1,Sheet2!R3C4:R55C15,2,FALSE)"
ActiveCell.Select
Selection.AutoFill Destination:=Range("C9:C16"), Type:=xlFillDefault
Range("C9:C16").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone

End Sub
--
Pl click the YES button
(if you see it - don''''''''t worry if you don''t),
if this answer was helpful.



"murkaboris" wrote:

Hello:

I wrote a macro that while being recorded returned the correct values, but
when I try to run it I'll get the run-time error '1004'.
Here is the excerpt from the macro that I'm trying to loop to run on
multiple worksheets of the workbook.

ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R3C1,'[ATF master file.xls]Orders OP'!R3C4:R55C15,2,FALSE)"
Selection.AutoFill Destination:=Range("C9:C16"), Type:=xlFillDefault
Range("C9:C16").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With

The problematic row is the one starting with "Selection.AutoFill"....
I'm pretty new to macros so although I can record a simple one, I'm unable
to correct it.

Please help.
Thank you.

Monika

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 248
Default Run-time error '1004': AutoFill method of Range class failed

Sorry for incomplete instructions and testing...

Use your macro...but you HAVE to be in Cell C9 before running the macro...

--
Pl click the YES button
(if you see it - don''''''''t worry if you don''t),
if this answer was helpful.



"murkaboris" wrote:

Hello Sheeloo:

I've replaced your section into my macro and still getting the same error.
Thanks

Monika

"Sheeloo" wrote:

I have added ActiveCell.Select to the macro shared by you..
assuming you want to copy the formula in A1 to C9:C16
Try
Sub t()
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R3C1,Sheet2!R3C4:R55C15,2,FALSE)"
ActiveCell.Select
Selection.AutoFill Destination:=Range("C9:C16"), Type:=xlFillDefault
Range("C9:C16").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone

End Sub
--
Pl click the YES button
(if you see it - don''''''''t worry if you don''t),
if this answer was helpful.



"murkaboris" wrote:

Hello:

I wrote a macro that while being recorded returned the correct values, but
when I try to run it I'll get the run-time error '1004'.
Here is the excerpt from the macro that I'm trying to loop to run on
multiple worksheets of the workbook.

ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R3C1,'[ATF master file.xls]Orders OP'!R3C4:R55C15,2,FALSE)"
Selection.AutoFill Destination:=Range("C9:C16"), Type:=xlFillDefault
Range("C9:C16").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With

The problematic row is the one starting with "Selection.AutoFill"....
I'm pretty new to macros so although I can record a simple one, I'm unable
to correct it.

Please help.
Thank you.

Monika

Reply
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
Error 1004 Copy method of worksheet class failed Ayo Excel Discussion (Misc queries) 3 March 28th 08 02:05 PM
Runtime 1004 error -- insert method of range class failed. tish Excel Discussion (Misc queries) 1 June 1st 07 04:04 PM
Run-Time error '1004' : Select method of Range class failed [email protected] Excel Discussion (Misc queries) 3 March 9th 07 01:36 PM
Run-time error "1004" Select method of range class failed Tallan Excel Discussion (Misc queries) 3 March 7th 07 05:22 PM


All times are GMT +1. The time now is 12:41 AM.

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

About Us

"It's about Microsoft Excel"