Range

accessman2

Registered User.
Local time
Today, 06:32
Joined
Sep 15, 2005
Messages
335
Dim rg As Range, myRange As Range
Set myRange = Sheets(1).Range("A2", "B4:B12", "C4:C12")

For Each rg In myRange.Cells
rg = Null
Next

When I set the range "B4:B12", "C4:C12", the function doesn't work. If I remove "C4:C12", then it works.

What's the problem?
 
The problem is is only works within one set of quotation marks. You need to list them as such:
Set myRange = Sheets(1).Range("A2,B4:B12,C4:C12")
 

Users who are viewing this thread

Back
Top Bottom