Transferring content from sheet1 to sheet2

Copper Contributor

Hi all,

I believe this is a simple one.

 

Sheet1

2 columns: column A contains text cells, column B contains info on the category of the text in A.

 

I need to transfer/copy into Sheet2 all the cells from column A which belong to two categories only.

 

Can it be done automatically, with either formulas (better) or macros?

 

Thank you.

7 Replies

@Francesco595 

 

The FILTER function can do it. I've been able to make it work with your data on one category at a time; I've not yet been able to incorporate an OR that would enable it to do both categories---but I'll keep trying.

Here's the formula: =FILTER(Foglio1!A2:B35,Foglio1!B2:B35="WHITE")

@Francesco595 

 

Well, there may be a more efficient way, but with a "Helper" column to identify the WHITE or RED categories in your first table, this FILTER function worked. See the attached file

=FILTER(Foglio1!A2:B35,Foglio1!C2:C35="Y")

Thank you very much @mathetes .

It appears that the FILTER function is not available on my Excel version (Home 2019)!

@Francesco595 

 

Hmm...I'm on Excel at home; here's the product info ...

mathetes_0-1585160232024.png

So then, you might just use the ability that's more longstanding, on the Data tab, to Filter. Put your cursor in one of the cells in your table and select Filter (you'll see it there on the right in the screen capture below). Once that has appeared, you can select the criteria you want by clicking on the little caret in the column heading and selecting the red and white categories, as I've done in the second image

 

mathetes_1-1585160422114.png

mathetes_2-1585160496598.png

after which you can copy and paste.

Dear @mathetes ,

Actually the FILTER function available with Office 365 is the right one.

The manual filtering option requires the user to take an action, that is what I need to avoid.

Any other suggestion, maybe with macros, which could hit the target?

 

Thank you

@Francesco595 

 

I'd assume that a macro of some kind could do this. I am not a user of macros, however, so I'll defer to someone else on that.

Thank you very much @mathetes for the support.

Much appreciated.