I have a double value I would like to increment, using the following snippet:
Total = CDbl(Total + CDbl(Workbooks(1).Worksheets(1).Cells(1,1).Value))
The code continuously returns a type mismatch error, even though the cell it points to has a decimal value in it. What am I doing wrong?
Make sure that the cell you are pointing to actually contains a number, and not merely the number’s text representation.
To convert a text cell to a number, select the cell, and then select Format/Cells from the menu bar, and then on the number tab, click General.