Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Run time error '91

In a standard module I have:
Any help appreciated.

Public Sub CopyFilter()
Dim rng1 As Range
Dim rng2 As Range
Sheets("POReqs").Select
With ActiveSheet.AutoFilter.Range <<< R/T Error Here _Why???
On Error Resume Next
Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1, 1)
.SpecialCells (xlCellTypeVisible)
On Error GoTo 0
End With
..... more code follows...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Run time error '91

Sorry, failed to add R/T comment:
Object Variable or With Block Variable not set


"Jim May" wrote in message
news:n_O_e.123078$Ep.67283@lakeread02...
In a standard module I have:
Any help appreciated.

Public Sub CopyFilter()
Dim rng1 As Range
Dim rng2 As Range
Sheets("POReqs").Select
With ActiveSheet.AutoFilter.Range <<< R/T Error Here _Why???
On Error Resume Next
Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1, 1)
.SpecialCells (xlCellTypeVisible)
On Error GoTo 0
End With
.... more code follows...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run time error '91

You would get that error if you don't have an autofilter on the worksheet.

With the autofilter dropdowns showing, no problem

? activesheet.autofilter.Range.address
$C$5:$C$17


--
Regards,
Tom Ogilvy

"Jim May" wrote in message
news:Q1P_e.123079$Ep.58874@lakeread02...
Sorry, failed to add R/T comment:
Object Variable or With Block Variable not set


"Jim May" wrote in message
news:n_O_e.123078$Ep.67283@lakeread02...
In a standard module I have:
Any help appreciated.

Public Sub CopyFilter()
Dim rng1 As Range
Dim rng2 As Range
Sheets("POReqs").Select
With ActiveSheet.AutoFilter.Range <<< R/T Error Here _Why???
On Error Resume Next
Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1, 1)
.SpecialCells (xlCellTypeVisible)
On Error GoTo 0
End With
.... more code follows...





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM


All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"