LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Running a variable macro when any value is entered into a variable

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
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
Variable Cell Value within a macro Ron (Bismark) Excel Discussion (Misc queries) 1 January 9th 07 02:31 AM
How to set variable to cell value in excel macro most xlent Excel Discussion (Misc queries) 6 October 27th 05 06:52 PM
Macro Creating Variable and using variable in a SQL statement Jimmy Excel Programming 4 October 25th 04 02:36 AM
Border around Data Entered in Variable Rows RGeneral Excel Programming 2 June 25th 04 11:02 PM
Writing variable from a Macro to a Cell Parker[_3_] Excel Programming 5 September 28th 03 03:47 AM


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