Closed Thread
Results 1 to 2 of 2

error '438', Object doesn't support this property or method.

Hybrid View

  1. #1
    Registered User
    Join Date
    07-26-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    error '438', Object doesn't support this property or method.

    I'm getting the following error msg: run-time error '438', Object doesn't support this property or method.

    The function below should loop through the first column and hide the row if "x" exists. The sheet will have a formula on the first column that will evaluate if there is data returned. The sheet is an accounting balance sheet and some accounts do not return data so I would like to hide it. If there is a better way please let me know, this is the simplest piece of code that I can understand.


    Function hidrows()
    Template.ActiveSheet.Protection.Enabled = False
    Template.ActiveSheet.Calculate
    
    For intRow = 1 To Template.ActiveSheet.UsedRange.Rows.Count
        If Template.Cells(intRow, 1).Value = "X" Or Template.Cells(intRow, 1).Value = "x" Then
            For intCol = 1 To Template.ActiveSheet.UsedRange.Columns.Count
                If Template.Rows(intRow).EntireRow.Hidden = False Then
                    Template.Rows(intRow).EntireRow.Hidden = True
                End If
            Next
        End If
    Next
    
    Template.ActiveSheet.Protection.Enabled = True
    
    End Function

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,996

    Re: error '438', Object doesn't support this property or method.

    Please don't just start a new question in the middle of an old one. I'm locking this one - the original is here.
    Everyone who confuses correlation and causation ends up dead.

Closed Thread

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