lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I want to fill blank cells with 0. The code below gave me error message
complaining that rows.count overflow. I changed it to 1000 and it worked
My question, why I got that error message, and how you would do it
using your programming style? Thank you very much.
I want to fill blank cells with 0. The code below gave me error message
complaining that rows.count overflow. I changed it to 1000 and it worked
My question, why I got that error message, and how you would do it
using your programming style? Thank you very much.
Code:
Sub fillblankcells()
Dim i As Integer
For i = 1 To Rows.Count
If Cells(i, 1).Value = "" Then
Cells(i, 1).Value = 0
End If
Next i
End Sub