Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All.......
I have a macro obtained long ago from this group......I keep re-using it with modifications on new projects. It now works fine it there is any results in the Autofilter, it fails when there is not, on line that reads, "With ActiveSheet.AutoFilter.Range".......it seems to me that it worked when I first got it, (maybe not, I almost never have no results on the autofilter) probably I've "enhanced" it to death........help please? Sub CopyFilterInquiry() Dim rng As Range Dim rng2 As Range Sheets("DATAINPUT").Select With ActiveSheet.AutoFilter.Range On Error Resume Next Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1, 1).SpecialCells(xlCellTypeVisible) On Error GoTo 0 End With If rng2 Is Nothing Then MsgBox "No data to copy" Else Worksheets("Inquiry").[DataRangeInquiry].Clear Set rng = ActiveSheet.AutoFilter.Range rng.Offset(1, 0).Resize(rng.Rows.Count - 1).Copy Destination:=Worksheets("Inquiry").Range("A9") End If Sheets("Inquiry").Select Range("a9").Select End Sub TIA Vaya con Dios, Chuck, CABGx3 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
emailing autofilter results | Excel Worksheet Functions | |||
Average over autofilter results | Excel Worksheet Functions | |||
Autofilter results | Excel Discussion (Misc queries) | |||
using macro to copy and paste filtered results, what if blank? | Excel Worksheet Functions | |||
Count of results in AutoFilter | Excel Programming |