Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Run-time Error 40036 on ActiveSheet

I get a Run-time error 40036 after the .Rows(STARTROW).Insert in this code


Public Sub HideBlanksAndZeros2()
Const MYCOL As String = "J"
Const STARTROW As Long = 8
Dim rng As Range

Application.ScreenUpdating = False
With ActiveSheet
.Rows(STARTROW).Insert
.UsedRange
With Intersect(.Cells(STARTROW, MYCOL).Resize(Rows.count - _
STARTROW), .UsedRange)
.AutoFilter Field:=1, Criteria1:="=", _
Operator:=xlOr, Criteria2:="=0"
On Error Resume Next
Set rng = .SpecialCells(xlCellTypeVisible)
On Error GoTo 0
.AutoFilter Field:=1
End With
End With
If Not rng Is Nothing Then rng.EntireRow.Hidden = True
ActiveSheet.Rows(STARTROW).Delete
Application.ScreenUpdating = True
End Sub



Any clues as to why?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Run-time Error 40036 on ActiveSheet

Hi Brent,

I was able to run the relevant portion of code without problem.Despite
trying everything I could think of that might cause a problem, I was unable
to replicate your error.

Sorry for my unhelpful reponse.

---
Regards,
Norman



"Brent Fidler" wrote in message
om...
I get a Run-time error 40036 after the .Rows(STARTROW).Insert in this code


Public Sub HideBlanksAndZeros2()
Const MYCOL As String = "J"
Const STARTROW As Long = 8
Dim rng As Range

Application.ScreenUpdating = False
With ActiveSheet
.Rows(STARTROW).Insert
.UsedRange
With Intersect(.Cells(STARTROW, MYCOL).Resize(Rows.count - _
STARTROW), .UsedRange)
.AutoFilter Field:=1, Criteria1:="=", _
Operator:=xlOr, Criteria2:="=0"
On Error Resume Next
Set rng = .SpecialCells(xlCellTypeVisible)
On Error GoTo 0
.AutoFilter Field:=1
End With
End With
If Not rng Is Nothing Then rng.EntireRow.Hidden = True
ActiveSheet.Rows(STARTROW).Delete
Application.ScreenUpdating = True
End Sub



Any clues as to why?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Run-time Error 40036 on ActiveSheet

Could not duplicate in Excel 2003

"Brent Fidler" wrote:

I get a Run-time error 40036 after the .Rows(STARTROW).Insert in this code


Public Sub HideBlanksAndZeros2()
Const MYCOL As String = "J"
Const STARTROW As Long = 8
Dim rng As Range

Application.ScreenUpdating = False
With ActiveSheet
.Rows(STARTROW).Insert
.UsedRange
With Intersect(.Cells(STARTROW, MYCOL).Resize(Rows.count - _
STARTROW), .UsedRange)
.AutoFilter Field:=1, Criteria1:="=", _
Operator:=xlOr, Criteria2:="=0"
On Error Resume Next
Set rng = .SpecialCells(xlCellTypeVisible)
On Error GoTo 0
.AutoFilter Field:=1
End With
End With
If Not rng Is Nothing Then rng.EntireRow.Hidden = True
ActiveSheet.Rows(STARTROW).Delete
Application.ScreenUpdating = True
End Sub



Any clues as to why?

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
ActiveSheet.Paste (error) Puzzled Excel Worksheet Functions 1 August 2nd 07 06:18 PM
Run time error 40036 TAM Excel Programming 0 May 14th 04 04:45 PM
If ActiveSheet = .. then - I get an error Eager2Learn[_4_] Excel Programming 2 May 3rd 04 05:19 AM
Error 40036 when activating a sheet shinydiamond Excel Programming 5 February 11th 04 10:11 PM
Run-time error 40036 Dick Kusleika Excel Programming 0 August 18th 03 04:54 PM


All times are GMT +1. The time now is 04:06 PM.

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

About Us

"It's about Microsoft Excel"