Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Lee Harris
 
Posts: n/a
Default Auto recalculate?

I have a nifty sheet that does some automated play calling for a game, and
it works fine if I just select a cell (empty one) and hit delete - it
re-randomises and picks a play

however, I tried adding a button and code to make it a clickable button, but
it doesn't seem to work. In addition, I cannot even remember how I added the
button or code (I got into VBA with Alt-F11 but am not sure how I linked the
code to the button, or whether somethings gone wrong)

I have other files with the same clickable button and exactly the same code
and it works fine.

If possible I would also like to be able to have a button on a separate tab
in the same file also randomising everything via the same recalculate method
if I can do that..

any help greatly appreciated. Can send file too if you like, only 53 KB
zipped up.


Private Sub CommandButton1_Click()
Calculate
End Sub


  #2   Report Post  
Tim C
 
Posts: n/a
Default Auto recalculate?

Try F9.

Tim C

"Lee Harris" wrote in message
...
I have a nifty sheet that does some automated play calling for a game, and
it works fine if I just select a cell (empty one) and hit delete - it
re-randomises and picks a play

however, I tried adding a button and code to make it a clickable button,
but it doesn't seem to work. In addition, I cannot even remember how I
added the button or code (I got into VBA with Alt-F11 but am not sure how
I linked the code to the button, or whether somethings gone wrong)

I have other files with the same clickable button and exactly the same
code and it works fine.

If possible I would also like to be able to have a button on a separate
tab in the same file also randomising everything via the same recalculate
method if I can do that..

any help greatly appreciated. Can send file too if you like, only 53 KB
zipped up.


Private Sub CommandButton1_Click()
Calculate
End Sub



  #3   Report Post  
Lee Harris
 
Posts: n/a
Default Auto recalculate?


"Tim C" wrote in message
...
Try F9.

Tim C


what does F9 do? I need it to be a button because I'm sending this sheet to
someone else and want it to look nice.



"Lee Harris" wrote in message
...
I have a nifty sheet that does some automated play calling for a game, and
it works fine if I just select a cell (empty one) and hit delete - it
re-randomises and picks a play

however, I tried adding a button and code to make it a clickable button,
but it doesn't seem to work. In addition, I cannot even remember how I
added the button or code (I got into VBA with Alt-F11 but am not sure how
I linked the code to the button, or whether somethings gone wrong)

I have other files with the same clickable button and exactly the same
code and it works fine.

If possible I would also like to be able to have a button on a separate
tab in the same file also randomising everything via the same recalculate
method if I can do that..

any help greatly appreciated. Can send file too if you like, only 53 KB
zipped up.


Private Sub CommandButton1_Click()
Calculate
End Sub





  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default Auto recalculate?

Try:

Option Explicit
Private Sub CommandButton1_Click()
Application.Calculate
End Sub

Since the code is under the worksheet and Calculate is not qualified by
anything, excel assumes you want just that worksheet calcuated.

The same as typing:
worksheets("sheet1").calculate
or behind the worksheet:
me.calculate



Lee Harris wrote:

I have a nifty sheet that does some automated play calling for a game, and
it works fine if I just select a cell (empty one) and hit delete - it
re-randomises and picks a play

however, I tried adding a button and code to make it a clickable button, but
it doesn't seem to work. In addition, I cannot even remember how I added the
button or code (I got into VBA with Alt-F11 but am not sure how I linked the
code to the button, or whether somethings gone wrong)

I have other files with the same clickable button and exactly the same code
and it works fine.

If possible I would also like to be able to have a button on a separate tab
in the same file also randomising everything via the same recalculate method
if I can do that..

any help greatly appreciated. Can send file too if you like, only 53 KB
zipped up.

Private Sub CommandButton1_Click()
Calculate
End Sub


--

Dave Peterson
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
Auto Protecting cells & auto filling date ccarmock Excel Discussion (Misc queries) 7 September 30th 05 09:21 PM
Averaging Values in Auto Filter Mr. Jan Park Excel Worksheet Functions 1 August 3rd 05 03:51 PM
AUTO SUM assi Excel Discussion (Misc queries) 1 April 21st 05 04:55 PM
excel links update not working in auto, calculations in auto Mikey Boy Excel Worksheet Functions 0 December 7th 04 11:53 PM
Why can't my macro use Auto Filter when I told the Sheet Protecti. KC Rippstein Excel Worksheet Functions 1 October 28th 04 06:13 PM


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