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


Hi all,

I have a worksheet change event for when a value is entered into cell
B2 as follows -

If Range("B2") < "" Then
Range("A2").Value = Now()

This successfully inputs the "NOW" value (I want the value so it does
not update - so an IF worksheet function cannot be used) into A2.

I would like for this to work anywhere on the column range...so if B3
has a value, A3 displays now...and so on.

I have tried to change the range in my VBA - and have used

Range(B, B)
Range("B:B")
Range(B2, B3000)
Range("B2:B3000")

But nothing seems to work correctly. The closest I have got was to get
the whole A column to populate with the value of now.

Any ideas on what I am doing wrong?

Thanks :)

Rob


--
systemx
------------------------------------------------------------------------
systemx's Profile: http://www.excelforum.com/member.php...o&userid=29254
View this thread: http://www.excelforum.com/showthread...hreadid=505652

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Worksheet Change Event

Try

If Not Intersect(Target,Columns("B:B")) Is Nothing Then
IF Target.Value <"" Then
Target.Offset(0,-1).Value = Now
End If
End If

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"systemx" wrote in
message ...

Hi all,

I have a worksheet change event for when a value is entered into cell
B2 as follows -

If Range("B2") < "" Then
Range("A2").Value = Now()

This successfully inputs the "NOW" value (I want the value so it does
not update - so an IF worksheet function cannot be used) into A2.

I would like for this to work anywhere on the column range...so if B3
has a value, A3 displays now...and so on.

I have tried to change the range in my VBA - and have used

Range(B, B)
Range("B:B")
Range(B2, B3000)
Range("B2:B3000")

But nothing seems to work correctly. The closest I have got was to get
the whole A column to populate with the value of now.

Any ideas on what I am doing wrong?

Thanks :)

Rob


--
systemx
------------------------------------------------------------------------
systemx's Profile:

http://www.excelforum.com/member.php...o&userid=29254
View this thread: http://www.excelforum.com/showthread...hreadid=505652



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
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Worksheet Change event LAF Excel Discussion (Misc queries) 3 January 4th 06 02:08 AM
worksheet change event? Steph[_3_] Excel Programming 5 March 28th 05 06:39 PM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM


All times are GMT +1. The time now is 02:19 AM.

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

About Us

"It's about Microsoft Excel"