Hi,
I am facing a very basic problem here. I am just trying to access a range in a worksheet and format it. But, the compilation of code (quite weirdly) generates the following error:
Run-time error '438': Object doesn't support this property or method
The code I am using is:
Public wb As Workbook
Public ws As Worksheet
Sub formatAll()
Dim r As Range
Set wb = ThisWorkbook
With wb
Set ws = .Worksheets("A")
End With
With ws
Set r = .Range("B1", "B3")
End With
With r
.Interior.Color = RGB(55, 123, 38)
End With
End Sub
The error is raised while setting the value for ws variable.
Please help!
Peace,
Shivboy
Bookmarks