#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 103
Default Autorun macro

OK, this is my attempt at making a static date so bear with me, i have 3
columns A- time. B- Data. C- Acutal Time. In the 'Actual Time' column it has
one cell being used with =NOW() in time format, and in the 'Time Column' it
has =IF(B20,C2). so that when i enter a value in the 'Data Column' it
transfers the current time into the 'Time Column' in the corresponding cell,
from here i have a macro which cuts and pastes the contents of the cell in
the 'Time' Column, it looks like this-------

Sub Macro2()
'
' Macro2 Macro
' copy paste
'

'
ActiveCell.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

Ok so finally to the question, I want this macro to Autorun anytime the
value in the Data column changes, so it would work entering the time into the
'Time Column' cell next to it, Is this possible, if it is would someone be
able to tell me what to type when i make the macro, sorry i know im a bit
ammature

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Autorun macro

As always, post your layout and code for comments. However, this macro may
do as desired without any formulas needed. It will put the time in col A
when you enter a number 0 in col B.
Right click the sheet tabview codeinsert this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count < 1 Then Exit Sub
If Target.Column < 2 Then Exit Sub
If IsNumeric(Target) And Target 0 Then
Target.Offset(, -1) = Time
End If
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Josh" wrote in message
...
OK, this is my attempt at making a static date so bear with me, i have 3
columns A- time. B- Data. C- Acutal Time. In the 'Actual Time' column it
has
one cell being used with =NOW() in time format, and in the 'Time Column'
it
has =IF(B20,C2). so that when i enter a value in the 'Data Column' it
transfers the current time into the 'Time Column' in the corresponding
cell,
from here i have a macro which cuts and pastes the contents of the cell in
the 'Time' Column, it looks like this-------

Sub Macro2()
'
' Macro2 Macro
' copy paste
'

'
ActiveCell.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

Ok so finally to the question, I want this macro to Autorun anytime the
value in the Data column changes, so it would work entering the time into
the
'Time Column' cell next to it, Is this possible, if it is would someone be
able to tell me what to type when i make the macro, sorry i know im a bit
ammature


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Autorun macro

IF?? you want the DATE and time then change to
Target.Offset(, -1) = now
for date only
Target.Offset(, -1) = date


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
As always, post your layout and code for comments. However, this macro may
do as desired without any formulas needed. It will put the time in col A
when you enter a number 0 in col B.
Right click the sheet tabview codeinsert this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count < 1 Then Exit Sub
If Target.Column < 2 Then Exit Sub
If IsNumeric(Target) And Target 0 Then
Target.Offset(, -1) = Time
End If
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Josh" wrote in message
...
OK, this is my attempt at making a static date so bear with me, i have 3
columns A- time. B- Data. C- Acutal Time. In the 'Actual Time' column it
has
one cell being used with =NOW() in time format, and in the 'Time Column'
it
has =IF(B20,C2). so that when i enter a value in the 'Data Column' it
transfers the current time into the 'Time Column' in the corresponding
cell,
from here i have a macro which cuts and pastes the contents of the cell
in
the 'Time' Column, it looks like this-------

Sub Macro2()
'
' Macro2 Macro
' copy paste
'

'
ActiveCell.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

Ok so finally to the question, I want this macro to Autorun anytime the
value in the Data column changes, so it would work entering the time into
the
'Time Column' cell next to it, Is this possible, if it is would someone
be
able to tell me what to type when i make the macro, sorry i know im a bit
ammature



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
AutoRun Macro chrisnsmith Excel Worksheet Functions 5 February 4th 09 07:25 PM
autorun a macro [email protected] New Users to Excel 2 January 24th 08 05:41 PM
Autorun Macro rexmann Excel Discussion (Misc queries) 2 August 2nd 06 02:03 PM
Autorun macro Kelly Excel Worksheet Functions 1 January 18th 06 04:03 PM
MACRO AUTORUN b52shut Excel Discussion (Misc queries) 1 December 15th 05 08:48 AM


All times are GMT +1. The time now is 04:12 AM.

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

About Us

"It's about Microsoft Excel"