Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excuting marco on entering data into a field

Hi,

Is there any way that i can excute a macro form entering data into a
field?

i.e. upon entering the word cancelled in to a cell in column G the
cells for that row in columns N to T automaticlly filled with N/A

I have used the the lookup formula but i need it as a macro

Regards
Paul


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excuting marco on entering data into a field

Use the worksheet change event

Test for the condition

see Chip Pearson's page on events

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"pauluk " wrote in message
...
Hi,

Is there any way that i can excute a macro form entering data into a
field?

i.e. upon entering the word cancelled in to a cell in column G the
cells for that row in columns N to T automaticlly filled with N/A

I have used the the lookup formula but i need it as a macro

Regards
Paul


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excuting marco on entering data into a field

Hi Paul,

Here's some code

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit
If Target.Column = 7 Then
If LCase(Target.Value) = "cancelled" Then
Cells(Target.Row, "N").Resize(1, 7).Value = "NA"
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub

Put it in the workshneet module (right-click the sheet name tab, click View
Code, and paste the code).

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"pauluk " wrote in message
...
Hi,

Is there any way that i can excute a macro form entering data into a
field?

i.e. upon entering the word cancelled in to a cell in column G the
cells for that row in columns N to T automaticlly filled with N/A

I have used the the lookup formula but i need it as a macro

Regards
Paul


---
Message posted from http://www.ExcelForum.com/



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
Trigger a Date & Time stamp by entering data in another field... mjjohnso Excel Worksheet Functions 4 April 11th 09 06:46 PM
how do you set up a field to flash upon entering sheet Al Excel Worksheet Functions 1 December 27th 07 03:00 PM
Pivot Field in Field List but Not Source Data AP[_2_] Excel Discussion (Misc queries) 0 November 1st 07 04:06 PM
Excel's Marco Convert data to Access Paul Excel Programming 1 August 15th 03 10:06 PM
write marco to put data from sheet to memory Desmond Leung Excel Programming 3 July 30th 03 05:27 AM


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