Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Can Save be added to this!


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


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,939
Default Can Save be added to this!

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
--
HTH...

Jim Thomlinson


"Bob" wrote:


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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Can Save be added to this!

Jim the name of the workbook is Cheques but I am getting a compile error on
Cheques.Save
Thanks Bob
"Jim Thomlinson" wrote in message
...
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
--
HTH...

Jim Thomlinson


"Bob" wrote:


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





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Can Save be added to this!

Oops sorry didn't actually need the name, fine now. Thanks
"Bob" wrote in message ...
Jim the name of the workbook is Cheques but I am getting a compile error
on Cheques.Save
Thanks Bob
"Jim Thomlinson" wrote in
message ...
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
--
HTH...

Jim Thomlinson


"Bob" wrote:


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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I've added hyperlinks to cells, but when I save the file they don' Dr. Darrell Excel Discussion (Misc queries) 1 December 18th 06 06:53 PM
added up none numbers Sheryl Excel Worksheet Functions 9 February 16th 06 02:48 PM
Added value to cell bbc1 Excel Discussion (Misc queries) 3 October 22nd 05 03:01 AM
How to save an excel spreadsheet as a text file without added quot Dozzle Excel Discussion (Misc queries) 2 April 11th 05 04:21 PM
Calculating VAT (value added tax) Rod Hutton Excel Worksheet Functions 2 December 10th 04 07:34 PM


All times are GMT +1. The time now is 03:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"