Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Event Macro help needed | Excel Discussion (Misc queries) | |||
Event Macro help needed | Excel Discussion (Misc queries) | |||
Cell value change to trigger macro (worksheet change event?) | Excel Programming | |||
Event Macro adjustment needed - need to change font color also | Excel Worksheet Functions | |||
Prevent Change in Event when not needed | Excel Programming |