Can Save be added to this!

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Can Cntrl-S be added to this script so each time it will save as well?
Thanks for any help...Bob
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextRow As Long
If Target.Address = "$E$162" Then

With Sheets("ChequesOut")

If .Range("C1").Value = "" Then
NextRow = 1
Else
NextRow = .Range("C" & Rows.Count).End(xlUp).Offset(1,
0).Row
End If

Me.Range("b162,E162").Copy _
Destination:=.Cells(NextRow, "C")

With .Cells(NextRow, "A")
.Value = Now 'date ???
.NumberFormat = "dd/mmm/yy " 'dd/mm/yyyy ????
End With

End With

Me.Range("B162").Select
End If
End Sub
 
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextRow As Long
If Target.Address = "$E$162" Then

With Sheets("ChequesOut")

If .Range("C1").Value = "" Then
NextRow = 1
Else
NextRow = .Range("C" & Rows.Count).End(xlUp).Offset(1,
0).Row
End If

Me.Range("b162,E162").Copy _
Destination:=.Cells(NextRow, "C")

With .Cells(NextRow, "A")
.Value = Now 'date ???
.NumberFormat = "dd/mmm/yy " 'dd/mm/yyyy ????
End With

End With

Me.Range("B162").Select
thisworkbook.Save '*****
End If
End Sub
 
Jim the name of the workbook is Cheques but I am getting a compile error on
Cheques.Save
Thanks Bob
 

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