Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change cell contents when pull down menu choices change | Excel Worksheet Functions | |||
making copied cells change with change in original cell | Excel Worksheet Functions | |||
Cell value change to trigger macro (worksheet change event?) | Excel Programming | |||
Change workbook sheet reference using cell A1 to change a vairable | Excel Worksheet Functions | |||
Change Cell from Validated List Not Firing Worksheet Change Event | Excel Programming |