View Single Post
 
Old 06-19-2018, 02:40 AM
Debaser's Avatar
Debaser Debaser is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

FWIW, I'd write your code more like this:

Code:
Sub button_click1()
    Dim lRow As Long
    lRow = ActiveCell.Row
    If ActiveSheet Is Sheets("Clipsal Customer") Then
        If Not Intersect(ActiveCell, Sheets("Clipsal Customer").Range("A4:Z5000")) Is Nothing Then
            With Sheets("Payment Advice")
                .Range("B3") = Date
                .Range("B4") = Cells(lRow, "a").Value
                .Range("B5") = Cells(lRow, "g").Value
                .Range("B6") = Cells(lRow, "h").Value
                .Range("B7") = Cells(lRow, "i").Value
                .Range("B8") = Cells(lRow, "j").Value
                .Range("B9") = Cells(lRow, "k").Value
                .Select
            End With
        End If
    End If
End Sub
Reply With Quote