Another Auto Fill variable length column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings:
Am trying to use the following as part of an existing process to copy down
formulas placed in G2 and I2, to variable length columns.

When trying to CALL the Private Sub, I get Error messages as detailed under
each CALL line:

' Copy formulas in G2 and I2 down thru to last used Row

Call Worksheet_Change
' Creates Compile Error: Argument not Optional

Call Worksheet_Change(ByVal Target As Range)
' Creates Compile Error: List seperator or )

End Sub

The following is the code I got from this group.
I understand what it is supposed to do. Hopefully it works OK when the CALL
problem is resolved.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim LRow As Long
If Target.Column = 1 Then
LRow = Cells(Rows.Count, 1).End(x1Up).Row
Application.EnableEvents = False
Range("G2").AutoFill Destination:=Range("G3:G" & LRow)
Range("I2").AutoFill Destination:=Range("I3:I" & LRow)
Application.EnableEvents = True
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top