Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to attach function to a custom Menubar?


Hi Rob van Gelder,
Thank you very much. But I am afraid that my concern for function i
still not addressed. I think you are again right. I am refering to th
custom formula function. In your modified code, you have used the o
action property to launch a macro called Button_Click. This is not wha
I want.

Lets say I have a following function in a standerd bas module.

Function Growth(rn As Range)
Growth = rn.Value + 10
End Function

Now I want to access this function from the menu button1 (withou
typing the function) This button, on action, runs a macro buton_clic
with parameter1.
In my case,
When user clicks on the button, it should show the popup for abov
function which accepts a range argument. You can select a range with
mouse and click on OK. This will insert the formula something lik
=Growth(A3) in the activecell and value will be displayed as value o
A3 +10.

I hope I have made myself clear. I should have given this explanatio
earlier.
Sorry for the inconvinience.

Regards,
Malco

--
Malcom Jaz
-----------------------------------------------------------------------
Malcom Jazz's Profile: http://www.excelforum.com/member.php...fo&userid=1587
View this thread: http://www.excelforum.com/showthread.php?threadid=27360

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default How to attach function to a custom Menubar?

You have the code for attaching to a commandbar, so I wont go over that
again.

Application.InputBox is magic (not to be confused with plain InputBox
without the Application. qualifier)

Sub Button_Click()
Dim rng As Range

On Error Resume Next
Set rng = Application.InputBox(Prompt:="Cell?", Type:=8)
If Err.Number < 0 Then Selection.Formula = "=Growth(" & rng.Address &
")"
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Malcom Jazz" wrote in message
...

Hi Rob van Gelder,
Thank you very much. But I am afraid that my concern for function is
still not addressed. I think you are again right. I am refering to the
custom formula function. In your modified code, you have used the on
action property to launch a macro called Button_Click. This is not what
I want.

Lets say I have a following function in a standerd bas module.

Function Growth(rn As Range)
Growth = rn.Value + 10
End Function

Now I want to access this function from the menu button1 (without
typing the function) This button, on action, runs a macro buton_click
with parameter1.
In my case,
When user clicks on the button, it should show the popup for above
function which accepts a range argument. You can select a range with a
mouse and click on OK. This will insert the formula something like
=Growth(A3) in the activecell and value will be displayed as value of
A3 +10.

I hope I have made myself clear. I should have given this explanation
earlier.
Sorry for the inconvinience.

Regards,
Malcom


--
Malcom Jazz
------------------------------------------------------------------------
Malcom Jazz's Profile:
http://www.excelforum.com/member.php...o&userid=15872
View this thread: http://www.excelforum.com/showthread...hreadid=273601



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
Custom Menubar Bret Excel Discussion (Misc queries) 1 August 19th 07 11:52 PM
How to attach function to a custom Menubar? Malcom Jazz[_6_] Excel Programming 0 November 1st 04 09:07 AM
How to attach function to a custom Menubar? Malcom Jazz[_5_] Excel Programming 1 November 1st 04 08:48 AM
How to attach function to a custom Menubar? Malcom Jazz[_4_] Excel Programming 0 October 29th 04 02:27 PM
attach custom toolbar to spreadsheet: how? Bart Plessers \(artabel\) Excel Programming 4 December 23rd 03 02:09 PM


All times are GMT +1. The time now is 02:35 AM.

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"