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?
EDIT: Row 1, Cell 1 is merged. It consists of 4 columns, so it is Row 1, Cell 1,2,3,4 in one column. If the cell is not merged then there is no problem.