Closed Thread
Results 1 to 2 of 2

Range related issues

  1. #1
    Registered User
    Join Date
    09-03-2008
    Location
    California
    Posts
    35

    Range related issues

    Hello All,

    I am trying to run this code but I keep getting an error which says:
    Runtime Error '5' - Invalid procedure call or argument.
    While debugging I realized its because of the variable iColumn holding an incorrect value. I expect it to be 256 instead it is 16384.
    Even after this observation I havent been able to debug the code shown below. Can someone help me with the problem?

    Thanks

    The following variables are declared constants and hold the value:

    START_COLUMN_LETTER = S
    COUNT = 1000
    Start Row = 8


    Function DeleteAllPivotTableFormats()
    Dim iRow As Integer
    Dim iColumn As Integer

    iRow = Range(START_COLUMN_LETTER & COUNT).End(xlUp).Row
    iColumn = Range(START_COLUMN_LETTER & iRow).End(xlToRight).Column

    With Range(Range(START_COLUMN_LETTER & START_ROW), Range(ParseColumnNumbersToLetters(iColumn) & iRow)).ClearFormats.ClearContents

    End With
    End Function

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Range related issues

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

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