tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,834
- Office Version
- 365
- 2019
- Platform
- Windows
It is common to omit the default property in VBA and code will still work.
For example:
and
both work equally well.
Is it true that the Range property DOES NOT have a default property?
I have seen:
and
ie the default property here for the Range object is Value.
but also:
and
the default property for Range is Cells?
Thanks
For example:
Code:
Cells(1,1) = 10
and
Code:
Cells(1, 1).Value = 10
both work equally well.
Is it true that the Range property DOES NOT have a default property?
I have seen:
Code:
Range("A1") = 20
and
Code:
Range("A1").Value = 20
ie the default property here for the Range object is Value.
but also:
Code:
Dim Rng As Range
Set Rng = Range("A1:D4")
Dim abc As Range
For Each abc In Rng
abc.Value= 30
Next abc
and
Code:
Dim Rng As Range
Set Rng = Range("A1:D4")
Dim abc As Range
For Each abc In Rng.Cells
abc.Value= 30
Next abc
the default property for Range is Cells?
Thanks