Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
AussieAVguy
 
Posts: n/a
Default Macro triggered by an event

Hi there,

I'm not too good with the whole VBA programming so I need some help to
create a macro.

What I need is a macro triggered by an event.

If I enter a value in a cell in col A I want the macro to automaticlly enter
the current time in Col B of the same row using the Now () function.

This is for an audio recording log sheet. I enter the microphone number
that a person speaks from and the time is automaticlly filled in in the cell
next to it. I can then do a VLOOKUP to get the persons name etc.

I'd also like to create a macro that copies the formulas from the current
row to the row below so that I don't have a log sheet 10 pages long when I
only have 5 pages of data entered.

Thanks for any help clever people

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Even though you're an Aussie I will try to help <bg

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A1000")) Is Nothing Then
With Target
.Offset(0, 1).Value = Time
.EntireRow.AutoFill .EntireRow.Resize(2)
.Offset(1, 0).ClearContents
Application.CutCopyMode = False
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

"AussieAVguy" wrote in message
...
Hi there,

I'm not too good with the whole VBA programming so I need some help to
create a macro.

What I need is a macro triggered by an event.

If I enter a value in a cell in col A I want the macro to automaticlly

enter
the current time in Col B of the same row using the Now () function.

This is for an audio recording log sheet. I enter the microphone number
that a person speaks from and the time is automaticlly filled in in the

cell
next to it. I can then do a VLOOKUP to get the persons name etc.

I'd also like to create a macro that copies the formulas from the current
row to the row below so that I don't have a log sheet 10 pages long when I
only have 5 pages of data entered.

Thanks for any help clever people



  #3   Report Post  
AussieAVguy
 
Posts: n/a
Default

Thanks Bob,

That works nicely.

Cheers

"Bob Phillips" wrote:

Even though you're an Aussie I will try to help <bg

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A1000")) Is Nothing Then
With Target
.Offset(0, 1).Value = Time
.EntireRow.AutoFill .EntireRow.Resize(2)
.Offset(1, 0).ClearContents
Application.CutCopyMode = False
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

"AussieAVguy" wrote in message
...
Hi there,

I'm not too good with the whole VBA programming so I need some help to
create a macro.

What I need is a macro triggered by an event.

If I enter a value in a cell in col A I want the macro to automaticlly

enter
the current time in Col B of the same row using the Now () function.

This is for an audio recording log sheet. I enter the microphone number
that a person speaks from and the time is automaticlly filled in in the

cell
next to it. I can then do a VLOOKUP to get the persons name etc.

I'd also like to create a macro that copies the formulas from the current
row to the row below so that I don't have a log sheet 10 pages long when I
only have 5 pages of data entered.

Thanks for any help clever people




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
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
automatic macro update boconnell Excel Worksheet Functions 4 February 9th 05 07:10 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 04:33 PM.

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"