Hi Rob,
Some good questions there.
When I was writing the code I knew that the count variable would end up being put on (or added to) a worksheet. All numbers on worksheets are Double data types, so I declared it as one. The code assumes that A11 contains a number (or a value which can be coerced to a number) otherwise an error will be raised.Why are you defining the count variable as a Double (instead of Long)?
As you know, # is the type declaration character for a Double data type. In the VBA IDE, if you type 1 in your code it will be read as an Integer. If you type 1# in it will be read as a Double. Since I am either adding or comparing Doubles, I used #.ditto for using the "#" sign on the end of the 1 & the end of the 0?
Normally I wouldn't use type declaration characters on forum posts because I think they make the code more confusing to people.
Bookmarks