Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple Date Stamp & Worksheet Change macros


Currently I use:

Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B2")) Is Nothing Then
SaveReferenceName
End If

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B2:B2")) Is Nothing Then
With Target
.Offset(1, 6).Value = Format(Date, "mm/dd/yy")
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

And in a seperate module:

Sub SaveReferenceName()
Dim s As String
s = ActiveSheet.Range("B2").Text
ActiveWorkbook.SaveAs "C:\New Quotes\" & s & ".xls"
End Sub

Which saves a new file as filename: (value in B2) whenever the cell B
is changed. Also, when cell B2 is changed, the date is stamped in H3.

But want I want to add is: when cell C9 is changed (ideally when valu
is "YES"), the date is stamped in E4. But the newbie I am, I just can'
get it to work!

Any solutions please!?
Thank you
Ale

--
alex386
-----------------------------------------------------------------------
alex3867's Profile: http://www.excelforum.com/member.php...fo&userid=3722
View this thread: http://www.excelforum.com/showthread.php?threadid=57052

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Multiple Date Stamp & Worksheet Change macros

one way:

Public Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Cells.Count = 1 Then
Select Case .Address(False, False)
Case "B2"
SaveReferenceName
On Error GoTo ws_exit
Application.EnableEvents = False
With Range("H3")
.Value = Date
.NumberFormat = "mm/dd/yy"
End With
Case "C9"
If UCase(.Value) = "YES" Then
On Error GoTo ws_exit
Application.EnableEvents = False
With Range("E4")
.Value = Date
.NumberFormat = "mm/dd/yy"
End With
End If
Case Else
End Select
End If
End With
ws_exit:
Application.EnableEvents = True
End Sub



In article ,
alex3867
wrote:

Currently I use:

Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B2")) Is Nothing Then
SaveReferenceName
End If

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B2:B2")) Is Nothing Then
With Target
.Offset(1, 6).Value = Format(Date, "mm/dd/yy")
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

And in a seperate module:

Sub SaveReferenceName()
Dim s As String
s = ActiveSheet.Range("B2").Text
ActiveWorkbook.SaveAs "C:\New Quotes\" & s & ".xls"
End Sub

Which saves a new file as filename: (value in B2) whenever the cell B2
is changed. Also, when cell B2 is changed, the date is stamped in H3.

But want I want to add is: when cell C9 is changed (ideally when value
is "YES"), the date is stamped in E4. But the newbie I am, I just can't
get it to work!

Any solutions please!?
Thank you
Alex

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
Time/Date Stamp Multiple Rows DataGuy Excel Discussion (Misc queries) 1 March 31st 09 03:45 AM
Date stamp when a value is entered in a cell on another worksheet bbrant2 Excel Worksheet Functions 1 January 21st 08 05:27 PM
MULTIPLE DATE/TIME stamp ruben Excel Worksheet Functions 3 May 6th 07 04:28 PM
I need a date stamp that doesn't change when you enter text Eric Hersey Excel Worksheet Functions 1 June 9th 06 06:40 PM
Create a button that will date stamp todays date in a cell Tom Meacham Excel Discussion (Misc queries) 3 January 11th 06 01:08 AM


All times are GMT +1. The time now is 04:33 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"