How do I Increase cell value in Excel using VBA? Error: Type mismatch
- by John
I'm writing a macro, but because I'm working for first time in vb, I faced problems.
My code:
Cells (1, 1).Select
Dim tempvar As Integer
tempvar = Val(Selection.Value) // error
Selection.Value = tempvar + 1
What my code should be:
Cells(1,1).Value+=1
I get error "type mismatch". How do I accomplish that?