Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Below is a code I am getting an error on. The error is on
the "Set rng" line. I know it has to do with my using an advanced filter rather than an autofilter but I don't know how to fix it. PS...thanks for all the help! Sheets("Stepdown").Select Columns("B:B").AdvancedFilter Action:=xlFilterInPlace, Unique:=True Dim rng As Range Set rng = Sheets("Stepdown").AutoFilter.Range rng.Copy Destination:=Worksheets("Stepdown2").Range ("A1") |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the built in capability to copy of the advanced filter:
Sheets("Stepdown").Select Columns("B:B").AdvancedFilter _ Action:=xlFilterCopy, _ CopyToRange:=Worksheets("Stepdown2") _ .Range("A1"), Unique:=True If you still need it filtered in place, repeat the advancedfilter action as well. Columns("B:B").AdvancedFilter _ Action:=xlFilterInPlace, _ Unique:=True -- Regards, Tom Ogilvy "scrabtree" wrote in message ... Below is a code I am getting an error on. The error is on the "Set rng" line. I know it has to do with my using an advanced filter rather than an autofilter but I don't know how to fix it. PS...thanks for all the help! Sheets("Stepdown").Select Columns("B:B").AdvancedFilter Action:=xlFilterInPlace, Unique:=True Dim rng As Range Set rng = Sheets("Stepdown").AutoFilter.Range rng.Copy Destination:=Worksheets("Stepdown2").Range ("A1") |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Code to conditional format all black after date specified in code? | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
option buttons run Click code when value is changed via VBA code | Excel Programming | |||
VBA code delete code but ask for password and unlock VBA protection | Excel Programming |