Copy rows into 3 different sheets based on specific criteria, using VBA

macevedos

New Member
Joined
Aug 14, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello everyone,

I have the following document, the information to copy is located in the sheet called "Source", where I want to copy the entire row into 4 different sheets, using VBA.

The columns that will be used as a condition are C, D, E, and F.

If Column C has the "TT" then, the entire row should be copied to the sheet "Tiny"
If Column D has the "Y7-10" then, the entire row should be copied to the sheet "7-10"
If Column E has the "Y11-13" then, the entire row should be copied to the sheet "11-13"
If Column F has the "Teens" then, the entire row should be copied to the sheet "Teen"

I'll appreciate your support on this matter, I've been trying several ways but obviously, I'm not so good.

Thank you!


Capture.PNG
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Welcome to the Board!

Instead of using VBA, this can be done really easily using the new Excel filter function.
All you need is one formula on each sheet, with your desired condition, and all the results will "spill" into that sheet.
See: FILTER function - Microsoft Support
 
Upvote 0
Hello Joe4,

You are totally right, I just watched the video and it's much simpler in this way.

Thank you!
 
Upvote 0
You are welcome!
Glad I was able to help.

Yes, that new FILTER function is a great new addition, and makes things a lot easier.
It is one my my favorite new functions to come around in a while!
 
Upvote 0

Forum statistics

Threads
1,215,132
Messages
6,123,227
Members
449,091
Latest member
jeremy_bp001

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