egor7
egor7

Reputation: 4950

When should I use value() on cells() in vba?

I'm trying to read and set Excel cells values with Cells(1,1). I was successful with reading this value. But I've seen code with Cells(1,1).Value(). So when should I use the notation itself: Cells(1,1) and notation with .Value() (Text()/Value2())?

Upvotes: 0

Views: 110

Answers (1)

Gareth
Gareth

Reputation: 5243

The default property of Cells in VBA is Value. There's no difference in using it vs not using it.

I prefer to explicitly define the Value property though for the sake of debugging and helping others who may read my code in future as it is a clear indication of what the code is trying to achieve.

Upvotes: 1

Related Questions