Use the Object Browser to determine what members (properties and methods) are available for the selected class (object). Use the IntelliSense feature in the Visual Basic Editor. When you type a period (.) after a property or method in the Visual Basic Editor, a list of available properties and methods is displayed.
VBA error 438 occurs when you try to use a property or method that does not support by that object. as you know all the objects have some properties and methods that you can use but there could be a situation when using a property or method that does not apply to a particular object.
I need to simply count the number of areas on a sheet. The code I have is :
Sub areas()
Dim i As Long
i = Worksheets("Sheet2").Selection.Areas.Count
MsgBox i
End Sub
But for some reason I get the error message "Object doesn't support this property or method." I have no idea why. This code was basically just copied from the Microsoft website.
I can't even get the immediate window to print the Worksheets("Sheet2").Selection.Areas.Count
portion.
Any quick help? I am using Excel 2010.
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With