#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell change


i would like to add the current date (say cell B5) when the value in
cell B4 is changed from sheets "Report"

Can you help?


--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=571820

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default cell change

you can use the change event.

right click on the Report sheet tab, select view code and insert code like
this

Private Sub Worksheet_Change( _
ByVal Target As Range)

if Target.Address = "$B$4" then
range("B5").Value = Date
range("B5").NumberFormat:="mm/dd/yyyy"
End if

End Sub

--
Regards,
Tom Ogilvy



"ceemo" wrote:


i would like to add the current date (say cell B5) when the value in
cell B4 is changed from sheets "Report"

Can you help?


--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=571820


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell change


lovely thank yo

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=57182

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell change


this doesnt actually work

has anyone got any ideas on how to fix this?


--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=571820

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default cell change

You sure you put the code in the correct spot--under the worksheet?

See Tom's instructions one more time.

But make one minor adjustment:

change this:
Range("B5").NumberFormat:="mm/dd/yyyy"
to
Range("B5").NumberFormat = "mm/dd/yyyy"

(drop the colon near the equal sign)

ceemo wrote:

this doesnt actually work

has anyone got any ideas on how to fix this?

--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=571820


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell change


i tried this but it didnt work. there were no errors and the code wa
accepted ok but it didnt populate the cell with the dat

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=57182

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default cell change

It worked for me.

Are you sure you put the code in the correct location.

Rightclick on the worksheet tab that should have this behavior. Select view
code and paste it in that code window.

Then back to excel and change B4 of that sheet.

ceemo wrote:

i tried this but it didnt work. there were no errors and the code was
accepted ok but it didnt populate the cell with the date

--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=571820


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default cell change

ps.

Did you enable macros to run when you opened the workbook?

Tools|macro|security|Security level tab

Choose medium to be prompted (and answer yes)
or
choose low to always allow (MS doesn't recommend this, though)

ceemo wrote:

i tried this but it didnt work. there were no errors and the code was
accepted ok but it didnt populate the cell with the date

--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=571820


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell change


yeo got it wrking thank

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=57182

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
change cell contents when pull down menu choices change jb21 Excel Worksheet Functions 3 November 21st 08 10:34 PM
making copied cells change with change in original cell Jennifer Mcdermeit Excel Worksheet Functions 2 July 20th 06 04:58 PM
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Change workbook sheet reference using cell A1 to change a vairable Reed Excel Worksheet Functions 4 January 20th 05 07:15 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:13 PM.

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"