Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to call a macro from a worksheet event?

Dear all,

I need to call a macro when data is pasted into a particular cell on
particular worksheet. I am having a few problems with this, any hel
would be greatly appretiated.

Many thanks,

To

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default how to call a macro from a worksheet event?

Use a worksheet change event by right click on sheet tabview codeinsert
thismodifysave
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$F$1" Then Exit Sub
Call mysub
End Sub
Sub mysub()
MsgBox "Hi"
End Sub

--
Don Guillett
SalesAid Software

"lopsided" wrote in message
...
Dear all,

I need to call a macro when data is pasted into a particular cell on a
particular worksheet. I am having a few problems with this, any help
would be greatly appretiated.

Many thanks,

Tom


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to call a macro from a worksheet event?

Hi Don,

That worked fine - i didnt realise this code needed to go in the
worksheet code, i kept trying to put coding in a separate module!

Many thanks,

Tom


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default how to call a macro from a worksheet event?

glad to help. UDF functions need to go in a general module. In the
ThisWorkbook module there is code that will act of EACH sheet in the
workbook. Take a look.

--
Don Guillett
SalesAid Software

"lopsided" wrote in message
...
Hi Don,

That worked fine - i didnt realise this code needed to go in the
worksheet code, i kept trying to put coding in a separate module!

Many thanks,

Tom


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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default how to call a macro from a worksheet event?

You need to use the worksheet change event (doubleclick the sheet name
in VB Editor) :-

'------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$A$1" Then MsgBox ("change")
End Sub
'-------------------------------------------------




lopsided wrote in message ...
Dear all,

I need to call a macro when data is pasted into a particular cell on a
particular worksheet. I am having a few problems with this, any help
would be greatly appretiated.

Many thanks,

Tom


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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to call a macro from a worksheet event?

aah it all makes sense now!
cheers,
Tom


---
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
worksheet function in event macro Ita Excel Worksheet Functions 3 May 25th 09 10:56 AM
how to call the event of other worksheet chad Excel Worksheet Functions 1 May 30th 07 09:48 AM
call a function on control click event tkraju via OfficeKB.com Excel Discussion (Misc queries) 7 August 25th 06 07:22 AM
call a sub with arguments from Worksheet_FollowHyperlink event Tom Ogilvy Excel Programming 5 August 28th 03 10:58 PM
macro to apply worksheet event to active worksheet Paul Simon[_2_] Excel Programming 3 August 7th 03 02:50 AM


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