[Solved] Macro find clipboard value

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Alfa_R
Posts: 3
Joined: Tue Jan 09, 2018 1:13 pm

[Solved] Macro find clipboard value

Post by Alfa_R »

Hello,

i have some basic problem but i am unable to find easy solution.
I try to create macro to copy current cell value in sheet 2, go to sheet 1 find that value.
I am using macro recorder and it record all steps correctly except it find always recorded value.

So recorder dont record ctrl-v in find, only what i have pasted in recording procces.

Code: Select all

args6(10).Name = "SearchItem.SearchString"
args6(10).Value = "0800089"
Is there easy way to fix it?
Like Value=clipboard?

To have bigger picture what iam doing - after finding that value i go back to sheet 2, move cursor by two cell in row, copy that value, move cursor in sheet 1 in correct cell in row and paste it.
Last edited by Hagar Delest on Wed Jan 10, 2018 12:18 am, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 4.1.2 on Windows 8
User avatar
JohnSUN-Pensioner
Volunteer
Posts: 876
Joined: Fri Jan 14, 2011 1:21 pm
Location: Kyiv, Ukraine

Re: Macro findclipboard value

Post by JohnSUN-Pensioner »

Welcome to the forum!
Are you sure that you need a macro for this task? To put the desired value in the cell Calc has convenient functions VLOOKUP or INDEX and MATCH
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Alfa_R
Posts: 3
Joined: Tue Jan 09, 2018 1:13 pm

Re: Macro find clipboard value

Post by Alfa_R »

I am no very expert user. i have sheet all artical list with codes (and how much i have in store) and in next sheet i temporary paste from web cashier (web counter, english is not my primary language) html report with codes, articals names and how much of each i have sold weekly. Of course rows order and columns are not same therefore i though of search by code and macro.

If you think there is better way to do this please point me in right direction.

Thanks you.
OpenOffice 4.1.2 on Windows 8
User avatar
JohnSUN-Pensioner
Volunteer
Posts: 876
Joined: Fri Jan 14, 2011 1:21 pm
Location: Kyiv, Ukraine

Re: Macro find clipboard value

Post by JohnSUN-Pensioner »

Please look at this text - for the six years that have passed since its publication, nothing has changed.

In your case, you can get something like this

Code: Select all

=VLOOKUP(A1;new_data.$A$1:$C$25;3;0)
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Alfa_R
Posts: 3
Joined: Tue Jan 09, 2018 1:13 pm

Re: Macro find clipboard value

Post by Alfa_R »

Thanks you.
I did successfully created vlookup and to avoid 0 and NA i just copy numbers to table and replace 0 with nothing.
Saved a lot of time with this. Thanks you once again :)
OpenOffice 4.1.2 on Windows 8
Post Reply