I've been struggling with this one for a while now, having read several posts on here but can't seem to make it work.
I've got a workbook with several sheets, each of them containing a 'revision number' cell at different locations (e.g. cell X7 contains "Revision:" and cell Y7 the number, e.g. "4"). I'd like to write a macro that searches for the word "Revision:" and adds 1 to the value in the neighbouring cell. So far I've tried the code below, but get the error "Run-time error '13': Type mismatch." What am I doing wrong?
Thanks!
Sub RevNumbers()
For Each WS In ActiveWorkbook.Worksheets
For Each C In WS.Range("A:Z")
If C.Value = "Revision:" Then
C.Offset(0, 1).FormulaR1C1 = C.Offset(0, 1).Value + 1
End If
Next C
Next WS
End Sub
Bookmarks