Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ian,
Your code works for me. Perhaps events have been inadevertently turned off. To resolve this, in the VBE immediate window type: Application.EnableEvents = True and hit the Enter key. Incidentally, i think that your procedu Sub DATA1() Range("E9").Select ActiveCell.FormulaR1C1 = "=TODAY()" Range("E9").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("F9").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "" Range("F9").Select End Sub could be expressed as: '============= Sub DATA1() With Range("E9") .Value = Date .Offset(0, 1).ClearContents .Offset(0, 1).Select End With End Sub '<<============= --- Regards, Norman wrote in message oups.com... John I have tried using the worksheet_change event as follow: Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Column = 3 Then DATA1 End Sub Along with the Macro: Sub DATA1() Range("E9").Select ActiveCell.FormulaR1C1 = "=TODAY()" Range("E9").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("F9").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "" Range("F9").Select End Sub However, When I select C9 and click off it, nothing happens. Although E9 should have todays date value in it. Can you see where I am going wrong? I am using Excel 2003, and Column 3(C) is a dropdown list of values. Kind Regards |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variable Cell Value within a macro | Excel Discussion (Misc queries) | |||
How to set variable to cell value in excel macro | Excel Discussion (Misc queries) | |||
Macro Creating Variable and using variable in a SQL statement | Excel Programming | |||
Border around Data Entered in Variable Rows | Excel Programming | |||
Writing variable from a Macro to a Cell | Excel Programming |