Possible to use VLOOKUP in a macro?

Creating a macro - Writing a Script - Using the API

Possible to use VLOOKUP in a macro?

Postby moriturimax » Sun Sep 16, 2018 7:25 am

Is it even possible to use VLookup in a Basic Macro? I keep getting the Parenthesis Do Not Match Error. It's very confusing to search because most search results aren't totally clear on the difference between using the function on a spreadsheet versus using it in a macro.

Any quick help is appreciated...maybe I depend on it too much.
OpenOffice 4.1.5
Windows 10 Pro 64-bit
moriturimax
 
Posts: 14
Joined: Sat Sep 15, 2018 9:05 pm

Re: Possible to use VLOOKUP in a macro?

Postby Zizi64 » Sun Sep 16, 2018 9:38 am

Possible to use VLOOKUP in a macro?


Yes, you can use the cell functions in your macro code, but you must pass the arguments in an ARRAY type variable to the called function.
Here are some examples (the simple textual range name like "Sheet1.A1:C24" will not work):
https://forum.openoffice.org/en/forum/v ... 20&t=84945
https://forum.openoffice.org/en/forum/v ... 45&t=24323
http://ooo-forums.apache.org/en/forum/v ... 20&t=42702

https://forum.openoffice.org/en/forum/v ... 20&t=78686
Tibor Kovacs, Hungary; LO4.4.7, LO5.4.7 on Win7x64Prof.
PortableApps, winPenPack: LO3.3.0-LO6.1.0 and AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 7162
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Possible to use VLOOKUP in a macro?

Postby Zizi64 » Sun Sep 16, 2018 9:11 pm

Moriturimax, can you upload an ODF type sample file here?
Tibor Kovacs, Hungary; LO4.4.7, LO5.4.7 on Win7x64Prof.
PortableApps, winPenPack: LO3.3.0-LO6.1.0 and AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 7162
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 9 guests