basically you bring up the tagged hands in your main database, run "Export Report", and then run the macro on the report. the macro creates an expression filter that filters for all of the hands you have listed. switch to the hole cards DB, apply the expression, and voila.
- Code: Select all
Sub HandFilter()
Dim Doc As Object
dim Cell as object
dim i as integer
dim filter as string
dim Sheet as object
Doc = ThisComponent
Sheet = Doc.CurrentController.ActiveSheet
Cell = Sheet.getCellByPosition(0,1)
filter = "#Hand ## = '" & Cell.String & "'"
i = 2
Cell = Sheet.getCellByPosition(0,i)
while Cell.Type <> com.sun.star.table.CellContentType.EMPTY
filter = filter & " OR #Hand ## = '" & Cell.String & "'"
i = i+1
Cell = Sheet.getCellByPosition(0,i)
wend
Cell = Sheet.getCellByPosition(0,i+1)
Cell.String = filter
Doc.CurrentController.select(Cell)
End Sub
this is for Libreoffice Calc, but I'm sure it could be modded for Excel pretty easily. hth!