Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a workbook with several sheets in it, each one has a button which I
use to force recalculation of various things for a game based idea. When I do Alt-F11 I see that I have the following code Option Explicit Private Sub CommandButton1_Click() Application.Calculate End Sub but this appears under "VBAProject", "Microsoft Excel Objects" and then the code is on each sheet that I have a button for, obviously What I want to know is, can I retain the functionality I have BUT have it so that if I press a button on say the "Solitaire" worksheet, it only recalculates the stuff on that sheet Actually the fact that the buttons recalculate all sheets is OK for all buttons except one, so I guess what I really need is just a way to isolate the one button on the one sheet, so that it only randomises/recalculates on its own specific sheet does that make sense? tks in advance |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Option Explicit
Private Sub CommandButton1_Click() Me.Calculate End Sub Since you're in a worksheet module, "Me" refers to that worksheet that owns the code. Lee Harris wrote: I have a workbook with several sheets in it, each one has a button which I use to force recalculation of various things for a game based idea. When I do Alt-F11 I see that I have the following code Option Explicit Private Sub CommandButton1_Click() Application.Calculate End Sub but this appears under "VBAProject", "Microsoft Excel Objects" and then the code is on each sheet that I have a button for, obviously What I want to know is, can I retain the functionality I have BUT have it so that if I press a button on say the "Solitaire" worksheet, it only recalculates the stuff on that sheet Actually the fact that the buttons recalculate all sheets is OK for all buttons except one, so I guess what I really need is just a way to isolate the one button on the one sheet, so that it only randomises/recalculates on its own specific sheet does that make sense? tks in advance -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() "Dave Peterson" wrote in message ... Option Explicit Private Sub CommandButton1_Click() Me.Calculate End Sub Since you're in a worksheet module, "Me" refers to that worksheet that owns the code. thanks a lot! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Urgent Help Required on Excel Macro Problem | Excel Discussion (Misc queries) | |||
Problem With Reference Update | Excel Worksheet Functions | |||
Copy an Drag cell Formula Problem | Excel Discussion (Misc queries) | |||
problem office assistant | Excel Discussion (Misc queries) | |||
Freeze Pane problem in shared workbooks | Excel Discussion (Misc queries) |