Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Questing regarding Date Stamp

Hi,

I need a cell (U) to display the current date (and keep it) everytime i
change something in row W.
I found the following code:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("W2:W9999"), .Cells) Is Nothing Then
Application.EnableEvents = False
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy"
.Value = Date
End With
Application.EnableEvents = True
End If
End With
End Sub

I've got one main question, can i change this formula to also activate when
a formula value changes? (Let's say W2 is IF(A1="";"Empty";"Not Empty")

Now when i enter something in A1, W2 should change from Empty to Not Empty.
The Date Stamp code, however, does not see this as a change in the cell.. Is
there any way to solve this?

Greets & Thanks,
gunti
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Questing regarding Date Stamp

Target is A1 when change is made in A1... and your code runs only when range
is W2:W9999

One way is to check for Range("A1") also...
or have a separate IF for A1 just like the one you already have...

"Gunti" wrote:

Hi,

I need a cell (U) to display the current date (and keep it) everytime i
change something in row W.
I found the following code:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("W2:W9999"), .Cells) Is Nothing Then
Application.EnableEvents = False
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy"
.Value = Date
End With
Application.EnableEvents = True
End If
End With
End Sub

I've got one main question, can i change this formula to also activate when
a formula value changes? (Let's say W2 is IF(A1="";"Empty";"Not Empty")

Now when i enter something in A1, W2 should change from Empty to Not Empty.
The Date Stamp code, however, does not see this as a change in the cell.. Is
there any way to solve this?

Greets & Thanks,
gunti

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Questing regarding Date Stamp

It's not an option to let the macro check ~ 12 or more ranges (I just made a
simplified example). It has to detect a change in the formula value.

Thanks though,
Gunti

"Sheeloo" wrote:

Target is A1 when change is made in A1... and your code runs only when range
is W2:W9999

One way is to check for Range("A1") also...
or have a separate IF for A1 just like the one you already have...

"Gunti" wrote:

Hi,

I need a cell (U) to display the current date (and keep it) everytime i
change something in row W.
I found the following code:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("W2:W9999"), .Cells) Is Nothing Then
Application.EnableEvents = False
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy"
.Value = Date
End With
Application.EnableEvents = True
End If
End With
End Sub

I've got one main question, can i change this formula to also activate when
a formula value changes? (Let's say W2 is IF(A1="";"Empty";"Not Empty")

Now when i enter something in A1, W2 should change from Empty to Not Empty.
The Date Stamp code, however, does not see this as a change in the cell.. Is
there any way to solve this?

Greets & Thanks,
gunti

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
Separating date from a Date & Time stamp JT Excel Discussion (Misc queries) 9 June 10th 08 05:55 PM
Date Stamp Leon Excel Worksheet Functions 2 September 12th 07 02:07 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
Date stamp spreadsheet in excel to remind me of completion date Big fella Excel Worksheet Functions 1 October 18th 05 04:10 PM
date stamp Chris Excel Discussion (Misc queries) 2 May 10th 05 04:15 PM


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