#1   Report Post  
johnT
 
Posts: n/a
Default macro help

i have a row of cells that total other cells...i want to
initiate a macro if any cell in this row changes. any
ideas? thanks for your help.
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If target.row= 1 Then
With Target
'do your stuff
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

RP
(remove nothere from the email address if mailing direct)


"johnT" wrote in message
...
i have a row of cells that total other cells...i want to
initiate a macro if any cell in this row changes. any
ideas? thanks for your help.



  #3   Report Post  
johnT
 
Posts: n/a
Default

cant get it to work, shouldnt this be calculation event?
-----Original Message-----
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If target.row= 1 Then
With Target
'do your stuff
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

RP
(remove nothere from the email address if mailing direct)


"johnT" wrote in

message
...
i have a row of cells that total other cells...i want to
initiate a macro if any cell in this row changes. any
ideas? thanks for your help.



.

  #4   Report Post  
johnT
 
Posts: n/a
Default

should clarify, using excel 97
-----Original Message-----
cant get it to work, shouldnt this be calculation event?
-----Original Message-----
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If target.row= 1 Then
With Target
'do your stuff
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

RP
(remove nothere from the email address if mailing direct)


"johnT" wrote in

message
...
i have a row of cells that total other cells...i want

to
initiate a macro if any cell in this row changes. any
ideas? thanks for your help.



.

.

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
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 07:37 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Macro for multiple charts JS Excel Worksheet Functions 1 November 19th 04 03:44 AM


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