Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Event change Macro needed

I need a simple macro to recalculate the worksheet (not the entire
workbook) whenever any cell in the range B5:G5 is edited.

I'm assuming it's a simple combination of Worksheet_Change and
ActiveSheet.Calculate

I've looked at Chip Pearson's event macros page, but can't seem to get it
right.

Thanks in advance for you help
Bob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Event change Macro needed

Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Range("B5:G5"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Application.CalculateFull
Application.EnableEvents = True
End Sub

--
Gary's Student


"Bob Tarburton" wrote:

I need a simple macro to recalculate the worksheet (not the entire
workbook) whenever any cell in the range B5:G5 is edited.

I'm assuming it's a simple combination of Worksheet_Change and
ActiveSheet.Calculate

I've looked at Chip Pearson's event macros page, but can't seem to get it
right.

Thanks in advance for you help
Bob



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Event change Macro needed

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Me.Range("B5:G5"),Target) is Nothing _
Then Exit Sub
me.Calculate
End Sub

--
Regards,
Tom Ogilvy


"Bob Tarburton" wrote in message
...
I need a simple macro to recalculate the worksheet (not the entire
workbook) whenever any cell in the range B5:G5 is edited.

I'm assuming it's a simple combination of Worksheet_Change and
ActiveSheet.Calculate

I've looked at Chip Pearson's event macros page, but can't seem to get it
right.

Thanks in advance for you help
Bob




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Event change Macro needed

Thanks Guys

I just changed Calculate to ActiveSheet.Calculate and it gave me what I
wanted.

I almost had it in my previous tries but I placed it in the worksheet code
module instead of the standard code module. Doh!

"Bob Tarburton" wrote in message
...
I need a simple macro to recalculate the worksheet (not the entire
workbook) whenever any cell in the range B5:G5 is edited.

I'm assuming it's a simple combination of Worksheet_Change and
ActiveSheet.Calculate

I've looked at Chip Pearson's event macros page, but can't seem to get it
right.

Thanks in advance for you help
Bob



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
Event Macro help needed Mike H Excel Discussion (Misc queries) 0 February 26th 09 09:04 PM
Event Macro help needed edo Excel Discussion (Misc queries) 0 February 26th 09 08:53 PM
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Event Macro adjustment needed - need to change font color also nick s Excel Worksheet Functions 2 November 28th 05 05:50 PM
Prevent Change in Event when not needed JK Excel Programming 0 October 13th 03 08:10 PM


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

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

About Us

"It's about Microsoft Excel"