Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Getting an ActiveX command button to do a spreadsheet function

I have installed an ActiveX command button on a spreadsheet and I want it to
perfom a formula function.
I want the press of the button to calculate a formula.
The Formula is to be "=A1/A2" with the result being in a 3 decimal point %.
E.g. =A1/A2 where A1=100 and A2=200 then I want my result to be listed in A4
as a 2 decimal % (In this case the answer should be 50%)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 136
Default Getting an ActiveX command button to do a spreadsheet function

Private Sub CommandButton1_Click()
ActiveCell.FormulaR1C1 = "=R[-3]C/R[-2]C"
Range("A4").Select
Selection.NumberFormat = "0.000%"
End Sub

"Givvie" wrote:

I have installed an ActiveX command button on a spreadsheet and I want it to
perfom a formula function.
I want the press of the button to calculate a formula.
The Formula is to be "=A1/A2" with the result being in a 3 decimal point %.
E.g. =A1/A2 where A1=100 and A2=200 then I want my result to be listed in A4
as a 2 decimal % (In this case the answer should be 50%)

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Getting an ActiveX command button to do a spreadsheet function

Hi Gav123
Firstly thanks for your response. I unforunately havent got a clue what you
just wrote (I fumbled my way through the command buton!)
I tried to copy your formual and paste it into MVB.

But here's what my problem is. (I thought by adding a command button I might
be able to acheive what I want?) Maybe its a long winded way to do it...Is
there a simpler option??

I have values in cells E29 and F29 and I have a formula in G29 that is
"=E29/F29" formatted in a 3 decimal % format.
My problem is;
If I change a figue in anthoer cell elsewhere on the spreadsheet it would
change one of the figures in either E29 or F29. (thats what i want it to do)
However, the resultant calculation in G29 would not change unless I deleted
the formula (as stated above) and re entered it.
1. - Is there another formula I should be using in G29?
2. - Can I also acheive this result using the Command button and have that
result in F26?

"Gav123" wrote:

Private Sub CommandButton1_Click()
ActiveCell.FormulaR1C1 = "=R[-3]C/R[-2]C"
Range("A4").Select
Selection.NumberFormat = "0.000%"
End Sub

"Givvie" wrote:

I have installed an ActiveX command button on a spreadsheet and I want it to
perfom a formula function.
I want the press of the button to calculate a formula.
The Formula is to be "=A1/A2" with the result being in a 3 decimal point %.
E.g. =A1/A2 where A1=100 and A2=200 then I want my result to be listed in A4
as a 2 decimal % (In this case the answer should be 50%)

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 136
Default Getting an ActiveX command button to do a spreadsheet function

Ok this sounds like you haven't got your calculations set to automatic..to
check/change this..

Select ToolsOptionsCalculation and click the Automic radio button.

Your formula is sound and hopefully this should work..

Regards,

Gav

"Givvie" wrote:

Hi Gav123
Firstly thanks for your response. I unforunately havent got a clue what you
just wrote (I fumbled my way through the command buton!)
I tried to copy your formual and paste it into MVB.

But here's what my problem is. (I thought by adding a command button I might
be able to acheive what I want?) Maybe its a long winded way to do it...Is
there a simpler option??

I have values in cells E29 and F29 and I have a formula in G29 that is
"=E29/F29" formatted in a 3 decimal % format.
My problem is;
If I change a figue in anthoer cell elsewhere on the spreadsheet it would
change one of the figures in either E29 or F29. (thats what i want it to do)
However, the resultant calculation in G29 would not change unless I deleted
the formula (as stated above) and re entered it.
1. - Is there another formula I should be using in G29?
2. - Can I also acheive this result using the Command button and have that
result in F26?

"Gav123" wrote:

Private Sub CommandButton1_Click()
ActiveCell.FormulaR1C1 = "=R[-3]C/R[-2]C"
Range("A4").Select
Selection.NumberFormat = "0.000%"
End Sub

"Givvie" wrote:

I have installed an ActiveX command button on a spreadsheet and I want it to
perfom a formula function.
I want the press of the button to calculate a formula.
The Formula is to be "=A1/A2" with the result being in a 3 decimal point %.
E.g. =A1/A2 where A1=100 and A2=200 then I want my result to be listed in A4
as a 2 decimal % (In this case the answer should be 50%)

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 136
Default Getting an ActiveX command button to do a spreadsheet function

Forgot to say that you won't need a command button to achieve this, if the
Automatic calculation solution works...

Regards,

Gav.

"Givvie" wrote:

Hi Gav123
Firstly thanks for your response. I unforunately havent got a clue what you
just wrote (I fumbled my way through the command buton!)
I tried to copy your formual and paste it into MVB.

But here's what my problem is. (I thought by adding a command button I might
be able to acheive what I want?) Maybe its a long winded way to do it...Is
there a simpler option??

I have values in cells E29 and F29 and I have a formula in G29 that is
"=E29/F29" formatted in a 3 decimal % format.
My problem is;
If I change a figue in anthoer cell elsewhere on the spreadsheet it would
change one of the figures in either E29 or F29. (thats what i want it to do)
However, the resultant calculation in G29 would not change unless I deleted
the formula (as stated above) and re entered it.
1. - Is there another formula I should be using in G29?
2. - Can I also acheive this result using the Command button and have that
result in F26?

"Gav123" wrote:

Private Sub CommandButton1_Click()
ActiveCell.FormulaR1C1 = "=R[-3]C/R[-2]C"
Range("A4").Select
Selection.NumberFormat = "0.000%"
End Sub

"Givvie" wrote:

I have installed an ActiveX command button on a spreadsheet and I want it to
perfom a formula function.
I want the press of the button to calculate a formula.
The Formula is to be "=A1/A2" with the result being in a 3 decimal point %.
E.g. =A1/A2 where A1=100 and A2=200 then I want my result to be listed in A4
as a 2 decimal % (In this case the answer should be 50%)

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
Send Open Spreadsheet using Command button [email protected] Excel Discussion (Misc queries) 0 August 23rd 07 01:08 PM
Activex command to Hide/Unhide Scafidel Excel Worksheet Functions 3 February 16th 07 01:40 AM
Deleting a Command Button from my Spreadsheet DDrowe Excel Discussion (Misc queries) 2 November 7th 06 01:49 PM
How do I run a macro with an activex button? geo Excel Discussion (Misc queries) 0 January 17th 06 10:55 PM
Hyperlink added to an activex control button Dimmer Excel Discussion (Misc queries) 1 August 11th 05 03:06 PM


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