VBA Macro Help. Thanks!

mlibrett

New Member
Joined
Aug 11, 2011
Messages
12
I'm looking to create a macro that looks down a specified column for 4 different values (something like A, B, C, D) and if those values are there for it to highlight and copy the rows.

Anyone have any idea how to make this?

For example, if I had 20 columns of data, and I want to look down one column called "Country" for only the value USA. But when it sees USA I want it to highlight that entire row and bring it into a new worksheet.

I'm thinking you may be able to use an if statement for this?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
number of such question must have been answered even in this group. I suggest this

1.autofilter whole data for USA in that column
2.highlight filtered data and copy to another location.

as it is that simple no need for a macro.
 
Upvote 0

Forum statistics

Threads
1,226,735
Messages
6,192,733
Members
453,752
Latest member
Austin2222

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