View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Type Mismatch Error

Maybe...

Option Explicit
Sub testme()

Dim LastRow As Long
Dim RngToCopy As Range
Dim HowManyRows As Long

With ActiveSheet
LastRow = .Cells(.Rows.Count, "E").End(xlUp).Row

'using the last used cell in column A to get the row to copy
Set RngToCopy = .Cells(.Rows.Count, "A").End(xlUp)

HowManyRows = LastRow - RngToCopy.Row + 1

If HowManyRows 1 Then
RngToCopy.Resize(HowManyRows, 4).FillDown
End If
End With

End Sub



el dee wrote:

Hello,
Any ideas on the type misatch error I recieve here?
Sub Autofill()

LastRow = Range("E").End(xlUp)
Set Range1 = Range(Range("A2"), Range("D65536").End(xlUp).Offset(1, 0))
Range1.Select
Selection.Autofill Destination:=("Range1" & LastRow)

End Sub


--

Dave Peterson