J
JIM.H.
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
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