Hareborn
Hareborn

Reputation: 175

Clear cells within a range

I am having a issue clearing the contents in a range with a custom button I created in the ribbon. The button works fine, calls the function but only cell "A6" clears, nothing else. I have searched and searched and tried multiple other variations with the same results each time. Here are only a few of the attempts.

Function ClearSheet()

    Worksheets("Template").Range("A6, I100000").ClearContents

End Function


Function ClearSheet()

    Worksheets("Template").Range("A6, I100000").Clear

End Function

Function ClearSheet()

   With Worksheets("Template")
        .Range("A6, I100000").ClearContents
   End With

End Function

Function ClearSheet()
Dim Rng as Range
Rng  = Worksheets("Template").Range("A6, I100000")

    Rng.ClearContents

End Function

Function ClearSheet()

    Worksheets("Template").Range("A6, I100000").Value = ""

End Function

And a hundred others, What am I missing please help!!

Upvotes: 0

Views: 161

Answers (1)

Rdster
Rdster

Reputation: 1872

Because the proper usage of range is:

Range("A6:I100000").ClearContents

Upvotes: 2

Related Questions