Help with Writing Macros

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Ajdpilot
Posts: 2
Joined: Wed May 25, 2016 7:30 pm

Help with Writing Macros

Post by Ajdpilot »

I'm hoping someone who knows alot more than me about Macros can help me. I've been trying to get my head round writing Macros for ages now with no luck.

I'm trying to create a budget spreadsheet in OpenOffice Calc Version 4.0.0 running on Windows XP.

I'm trying to write a Macro that I will connect to a push button that when run will present the user with a drop down options box with the months of the year.
Depending on the users choice will then look in the tab named "Savings", search in between C7:C999 for matches to the month the user selected and copy data in columns A and B from the matching rows and paste it in the tab named "Budget" on the next available row in columns A and C respectfully. (The next available row will change depending on how many entries are already on that tab so will need the macro to find this. There are other things entered in rows 1-10 on the budget tab including some blank rows, so the starting place to look for next available row would be row 11 down)

I hope this all makes sense and someone can help me with this.

Thanks in advance,
Andy.
OpenOffice version 4.0.0
Running on Windows XP
RPG
Volunteer
Posts: 2250
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Help with Writing Macros

Post by RPG »

Hello

I think it is not a good idea to start with macro's. For a budget program it is good to work with a simple table in a spreadsheet. When you want make it a little better then use a simple database table. Then you can use a date control for inputting a date's.

When you have input your data then the pivot table is the best way to analyze your data. This can be done later. You need some lines of data.

It makes no problem if you start with a simple spreadsheet table or a simple database table. All data can be used later in a more complex way if you need.

Romke
LibreOffice 7.1.4.2 on openSUSE Leap 15.2
Ajdpilot
Posts: 2
Joined: Wed May 25, 2016 7:30 pm

Re: Help with Writing Macros

Post by Ajdpilot »

Thanks but I have already created the simple parts of the spreadsheet and am now trying to work towards automating as much as possible of it. I'm OK with formula within cells and sheets but I'm not good with writing macros and code. Everything that can be done with formula is already in place and I'm now trying to get code for various other parts of the sheet
OpenOffice version 4.0.0
Running on Windows XP
RPG
Volunteer
Posts: 2250
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Help with Writing Macros

Post by RPG »

Hello
Ajdpilot wrote:but I'm not good with writing macros and code
For this reason using the more built-in tools is more easy and better. When you start reading in the forum for macro's or in the forum for calc you can find maybe example code and also tutorials.

OpenOffice.org BASIC Programming Guide was for me the tutorial what give the best idea how to make my own macro.

Romke
LibreOffice 7.1.4.2 on openSUSE Leap 15.2
Post Reply