I have a simple VBA code that functions fine provided there are not any symbols in any of the cells. When there are symbols, I get the mismatch error. I have included "On error resume next" in my loop; however, the previous value is output into a cell instead of leaving it blank. How do I adjust my code so that when there is a symbol in an input cell, the output cell remains blank instead of just having the previous value placed?
![]()
Sub test() Dim num1 As Single, num2 As Single For i = 1 To 8 On Error Resume Next num1 = Sheet1.Cells(6 + i, 5) num2 = Sheet1.Cells(6 + i, 6) Sheet1.Cells(6 + i, 8).Value = num1 * num2 Next i End Sub
Bookmarks