# Calc, Copy a certain value from one sheet to another

My spreadsheet knowledge is really tiny, the last time i did advanced functions was in primary school.

I am trying to make a spreadsheet for a Card game to make sorting my collection easier.

So far I need it to show after a certain value if I have any to trade. so I found a =MAX(0,A14-B14) function (where the first column is the number I have and the second is the max amount I need) which will show me how many of that card I have to trade.

I have another row with a IF function showing if that card is complete returning a "yes" or a "no" (=IF (A14>=B12, "yes", "no"))

Now, I would like one more function. I need to be able to take the ROW of the card I have for trade and put it in a new sheet, based on if the collection is complete AND the number I have for trade is greater than 0, removing any spaces between rows.

I have seen something like this done using an advanced visual basic parameter, but im sure that this could be done using normal spreadsheet functionality.

Can anyone help me out?

as a bonus, I would also like to take cards that are not complete and put those in a new sheet.

https://ask.libreoffice.org/upfiles/1...

In the attached File you can see what i have so far... it reads count vs max and outputs a yes or no if complete, then tells me how many I have extra for trade.

I want to now do a check on if it is complete and I have trades (so if row J shows "yes" AND the For Trade number equal to or higher than 1 in row K)

I want it to then take that row and put it in a new sheet.

thanks

# !!UPDATE!!

Ok, I have decided to try do this using a macro button that runs a Libre office basic script, problem is that all i can find are scripts for Open office basic and excel and I am not sure how to convert them to Librebasic.

Tried asking on the Stackoverflow page, but the one answer I get is of a guy just basically saying "yup... that wont work..." without any constructive help.

This is what i have so far...

```
Option Compatible
Sub SWD_AwakeningsTrade
Dim i, LastRow
LastRow = Sheets("Card_List").Range("A" & Rows.Count).End(xlUp).Row
Sheets("Awakenings For trade").range("A2:I500").clearContents
For i=2 to LastRow
If Sheets("Card_List").Cells(i,"K").Value = "(>1)" Then
Sheets("Card_List").Cells(i, "K").EntireRow.Copy
Destination:=Sheets("Awakenings For trade").Range("A" & Rows.Count.end(xlUp)
End if
next i
End Sub
```

I keep getting a Syntax errors

anyone familiar with Librebasic?

Think that your question is too involving. Try to simplify. From my experience, shorter question has better answer rate. You might want to use PIVOT TABLES or VLOOKUP function in way that suit your need for completing your task successfully. Maybe here you'll find answer: https://forum.openoffice.org/en/forum...

I added Code tags to make your script more readable. It would help if you could advise the line where the error occurs, and the exact text of the error.

i edited my previous answer, including a macro that hopefully works for you