Results 1 to 8 of 8

Run time error 40036, similar procedures - works in one sheet not in the other

Threaded View

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    Rockland, WI
    MS-Off Ver
    Excel 2016
    Posts
    56

    Run time error 40036, similar procedures - works in one sheet not in the other

    I have 4 procedures in a workbook to clear worksheets’ rows; 3 of the procedures work, one generates “Run-time error 40036, Application defined or Object defined error”. My only difference in the procedures is the worksheet name. Can someone tell me why procedure “Public Sub ClrComparison()” generates the error? They are in module “modClearSheetRows”.

    These three work:
    Public Sub ClrCurrentPeriodData()
    
    'Clear CurrentPeriod data
     'in CurrentPeriod worksheet
      ThisWorkbook.Worksheets("CurrentPeriod"). _
      UsedRange.Offset(2, 0).Clear
    
    End Sub
    Public Sub ClrDifArraySheet()
    
     'Clear existing Comparison Differences
     'in DifArray worksheet
      ThisWorkbook.Worksheets("DifArray").UsedRange.Offset(1, 0).Clear
    
    
    End Sub
    Public Sub ClrPreviousPeriodData()
    
    'Clear PreviousPeriod data
     'in PreviousPeriod worksheet
      ThisWorkbook.Worksheets("PreviousPeriod"). _
      UsedRange.Offset(2, 0).Clear
    
    End Sub
    This one generates the run time error

    Public Sub ClrComparison()
    
    'Clear Comparison data
     'in Comparison worksheet
      ThisWorkbook.Worksheets("Comparison"). _
      UsedRange.Offset(2, 0).Clear
            
    End Sub
    Attached Files Attached Files
    Last edited by jdfjab; 06-14-2012 at 09:24 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1