Macro to find specific word within entire file, if word present, paste row of data with corresponding table headers

stalktrader

New Member
Joined
Apr 14, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi, I'm trying to find a string of text or numbers within the entire file (across all worksheets), and if the string is present, paste the whole row and the corresponding table headers. The reason I say text instead of numbers is because sometimes the numbers will be within random text in a cell. After the word is found, I would like to paste that entire row of table data into a new worksheet with the table's headers. Ideally, it would be even better if I could just have that data saved to the clipboard (not sure if this is possible w/ VBA).

The way I've been doing it right now is using the filter function, but in order to do that I need to select a table and column first, and since the string I'm looking for will be unique to the entire workbook, I would rather be able to search across all worksheets for that text (it will always be part of a table).

Thank you for the help.


EDIT:
This is an example of what I've been using: =FILTER(A1:O41,C1:C41="Utilities")

The problem is that it's not a macro, it makes me choose a table first, and I can't run just blanket run it across all sheets but I will have to do that since the data can be in any number of 10 different sheets, and I never know which number it will be in, so I can't reference it in the macro.
 
Last edited by a moderator:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,214,950
Messages
6,122,438
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top