Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Macro error 1004

Hello
the following code gives 1004 error at the last line, what
is problem? Can you do it in any other way?
Thanks,
Jim.


Sub Macro1()
'
Dim mySourceDataRng As Range

With Worksheets(1)
Set mySourceDataRng = .Range("E2:F" _
& .Cells
(.Rows.Count, "A").End(xlUp).Row)
End With

Range("E2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(RC[-2],""Test-1*"")"
Range("F2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]=1,""1-Test"",RC[-
3])"
Range("E2:F2").Select
'Selection.AutoFill Destination:=Range("E2:F11"),
Type:=xlFillDefault
Selection.AutoFill Destination:=Range
(mySourceDataRng), Type:=xlFillDefault

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro error 1004

Just a guess ... instead of

Selection.AutoFill Destination:=Range
(mySourceDataRng), Type:=xlFillDefault

You want

Range(mySourceDataRng).AutoFill Destination:=Range
(mySourceDataRng), Type:=xlFillDefaul

--
Message posted from http://www.ExcelForum.com

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
Macro Error 1004 JB63 Excel Discussion (Misc queries) 3 May 29th 09 03:55 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
MACRO Run Time Error 1004 The Toasterman Excel Discussion (Misc queries) 1 June 30th 06 04:22 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 08:01 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"