VBA Excel - Cells(row,col).value question

Both of the following statements are working.  Is the ".value" optional ?

Cells(RowCount, 7) = CommissionAmt


Cells(RowCount, 7).value = CommissionAmt
brothertruffle880Asked:
Who is Participating?
 
BobMakarowskiCommented:
I have not seen any official documentation on whether it's a default method but I'd keep it in for several reasons:
- All the documentation shows that it's proper form to include it.
- Perhaps sometime in the future, they'll be changes to VBA which might throw a monkey wrench into your code that DOES NOT include the "dot value" clause.
- Think about the future programmers who will be maintaining your code once you move in.  KEEP IT IN!
0
 
jppintoCommented:
I believe so. I've used also both solutions and both work well. I'm not sure what is the difference, if there is...
0
 
Saqib Husain, SyedEngineerCommented:
Frequently both work OK but there may be instances where it would not work and would become a nightmare to debug it. So it is safest to always use it.
0
 
celazkonCommented:
It's the default method, therefore can be omitted. But generally, it's wise to write it, 'cause of the code appearance and orientation
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.