Formula to paste content of a cell from a different workbook if yet another cell contains one of several words?

Judykay4444

New Member
Joined
Dec 11, 2023
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Actually what I'm trying to do is copy the entire row over into another sheet if the contents of what's in the first cell (column A) of that row contains "X". but it doesn't have to be an exact match. In fact, that's what's tripping me up. Sometimes it could say CC and sometimes it could be spelled out as Critical Care. So I want the formula to say "if cell A2 contains either the words CC or Critical, then paste the whole row over (or paste cell B2)". If I can't paste the whole row, then I'll do it cell by cell. I think there'd have to be a macro to do the whole row. In fact, I did find someone on youtube who wrote a macro and it worked wonderfully, but the text "CC" had to be an exact match and I couldn't say to please find either/or CC, Critical Care, UC... whichever hospital line I'm looking for which might be referred to in several different ways. So I couldn't use his macro. Now I'm just searching for a formula to put in each cell to pull it cell by cell. I can leave the formulas in the cells and when I'm working in Sheet1 which will have all the information with all the hospitals no matter what service line they are, the cells in the other workbooks will just populate and I can have several different workbooks separating out the individual service lines. I hope.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Actually what I'm trying to do is copy the entire row over into another sheet if the contents of what's in the first cell (column A) of that row contains "X". but it doesn't have to be an exact match. In fact, that's what's tripping me up. Sometimes it could say CC and sometimes it could be spelled out as Critical Care. So I want the formula to say "if cell A2 contains either the words CC or Critical, then paste the whole row over (or paste cell B2)". If I can't paste the whole row, then I'll do it cell by cell. I think there'd have to be a macro to do the whole row. In fact, I did find someone on youtube who wrote a macro and it worked wonderfully, but the text "CC" had to be an exact match and I couldn't say to please find either/or CC, Critical Care, UC... whichever hospital line I'm looking for which might be referred to in several different ways. So I couldn't use his macro. Now I'm just searching for a formula to put in each cell to pull it cell by cell. I can leave the formulas in the cells and when I'm working in Sheet1 which will have all the information with all the hospitals no matter what service line they are, the cells in the other workbooks will just populate and I can have several different workbooks separating out the individual service lines. I hope.
 

Attachments

  • example sheet.png
    example sheet.png
    171.7 KB · Views: 7
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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