Selecting cells returned after using autofilter

colinharwood

Active Member
Joined
Jul 27, 2002
Messages
417
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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

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
417
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
417
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

Some contain text some numbers and some formulas

Cheers

Colin
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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,148,216
Messages
5,745,431
Members
423,951
Latest member
peggrif

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