Hi,
I am in the middle of testing my first attempt at using VBA code and to my dismay am running into difficulties. I have used the following VBA code in a For loop to check for empty cells in a spreadsheet:
If Cells(i, 1).Value <> "" And Cells(i, 13).Value <> "" And Cells(i, 20).Value <> 0 And Cells(i + 1, 12).Value < Cells(i, 12).Value Then
The contents in Cell(i,1) is text from a list (can be blank). Cells(i,13) is a date and the contents of the other cells in the code contain numbers.
Each time I run the code I receive a message "Run time error 13: type mismatch". I suspect that I may have to dimension a variable or something of the like. I have searched various websites and have not been able to find something that works.
Appreciate assessment and advice.
I am in the middle of testing my first attempt at using VBA code and to my dismay am running into difficulties. I have used the following VBA code in a For loop to check for empty cells in a spreadsheet:
If Cells(i, 1).Value <> "" And Cells(i, 13).Value <> "" And Cells(i, 20).Value <> 0 And Cells(i + 1, 12).Value < Cells(i, 12).Value Then
The contents in Cell(i,1) is text from a list (can be blank). Cells(i,13) is a date and the contents of the other cells in the code contain numbers.
Each time I run the code I receive a message "Run time error 13: type mismatch". I suspect that I may have to dimension a variable or something of the like. I have searched various websites and have not been able to find something that works.
Appreciate assessment and advice.