I'm trying to make a macro in open office calc that basically does this:
1. Moves to cell A1.
2. Clicks a button in A1 that runs another macro.
3. Copies the result of that macro.
4. Pastes the result into cell A2.
The problem is the macro in step that I'm trying to run doesn't run (but it does run good by itself, when not inside this macro I'm trying to make).
Can this even be done? If so, is there a fairly easy way to get it done (iadummy, not an advanced spreadsheet whiz ? Got any advice? TIA for all help!
[Solved] Macro within a macro in AOO Calc. Is it possible?
[Solved] Macro within a macro in AOO Calc. Is it possible?
Last edited by Hagar Delest on Mon Sep 25, 2017 1:00 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
Open Office 4.1.2 on Windows 7
Re: Macro within a macro in open office calc. Is it possible
Steps 1 and 2 are not necessary. One macro subroutine can simply call another. It sounds like the macro associated with the button is a function, it returns a value. The structure of your code would then be
Code: Select all
function MyFunc(Var)
...code...
MyFunc = SomeValue
End Function
Sub MyProcedure
p = ResultOfSomeCode
x = MyFunc(p)
...Write x to cell A2...
End Sub
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
SOLVED! Re: Macro within a macro in AOO Calc. Is it possible
I have to call this "solved" for possibly 2 reasons.
The for sure reason is, after I sent this message I found that if I clicked the button to start the macro, then went behind the macro and changed the number in the cell, I could get the entire macro to work. (Clicking the macro changed the number behind the button to "1", which triggers the macro. So instead of continuing to press the button, I continued to change the number to "1" and it works the way I want.
The second possible reason is the answer you gave me, which I didn't check to see if it works. But if it does, well, that's 2 ways to do it.
Thanks for the help!
The for sure reason is, after I sent this message I found that if I clicked the button to start the macro, then went behind the macro and changed the number in the cell, I could get the entire macro to work. (Clicking the macro changed the number behind the button to "1", which triggers the macro. So instead of continuing to press the button, I continued to change the number to "1" and it works the way I want.
The second possible reason is the answer you gave me, which I didn't check to see if it works. But if it does, well, that's 2 ways to do it.
Thanks for the help!
Open Office 4.1.2 on Windows 7