Selecting cells returned after using autofilter

colinharwood

Active Member
Joined
Jul 27, 2002
Messages
419
Office Version
  1. 2019
Platform
  1. Windows
Hi

Is it possible to write a Macro which will select only the rows with data in, after using autofilter, so that they may be copied to another worksheet.

Thanks a lot
Colin
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
The code:

Selection.SpecialCells(xlCellTypeAllValidation).Select

Should work for you to select your validated cells

HTH
kevin
 

colinharwood

Active Member
Joined
Jul 27, 2002
Messages
419
Office Version
  1. 2019
Platform
  1. Windows
I tried that but got an error message saying "No cells found"

Any ideas

Colin
 

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
I gave you the wrong syntax - AllValidation wouldn't work for you in your case.

what kind of information do the cells that you are autofiltering contain?
 

colinharwood

Active Member
Joined
Jul 27, 2002
Messages
419
Office Version
  1. 2019
Platform
  1. Windows
Some contain text some numbers and some formulas

Cheers

Colin
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
On 2002-08-29 15:03, colinharwood wrote:
Some contain text some numbers and some formulas

Cheers

Colin

You could also try Advanced Filter that allows you copy/filter to another location in even another worksheet.
 

Forum statistics

Threads
1,182,025
Messages
5,933,333
Members
436,888
Latest member
Kantonides

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
Top