Help to create a Filter & Restore Sheet macro's

I have just migrated to Calc and I have spend days - without success, trying to create 2 filter macro’s in Calc that I used to use in Excel. I am hoping that someone can help me with this.

I have a table with a range of B9:AAZ5000 (row 9 is the header row).
However, for this filter task only text in the range D10:D5000 is searched - based on the text search criteria in cell D6.

What each macro needs to do:

Filter Macro

  1. Clear cell D6
  2. Paste the clipboard to cell D6 (D6 being the Search Criteria)
  3. Filter the range D10:D5000 based the cell D6 Search Criteria (this results in only rows with matching text in D6 and range D10:D5000 being displayed)

Restore Sheet

  1. Clear the search criteria in cell D6
  2. Clear the filter and/or
  3. Unhide/Show the hidden rows caused by the filter macro above
  4. Return the cursor to Cell A10

I am really hoping someone can help me with these macro, as I am getting no where on my own.
Thank you in advance