I have a big excel file with different dates on Column B (it starts at row 7 and jump to the row 9.. e.g June6th - B7, June 7th - B9, June 8th - B11). I want to have a macro that locate the first empty cell (jumping 1 row.. for example cell B7 has a date on it, so the macro should verify if the cell B9 is empty, not B8) and then ask the user to input the Date on this cell. Is it possible?
Thank you!
Sub BallMillInspection()
Dim BallMillNumber As String
' IDENTIFY WHAT BALL MILL
BallMillNumber = InputBox("Enter Ball Mill Number, e.g. 1")
If BallMillNumber = vbNullString Then Exit Sub
If BallMillNumber > 5 Then
MsgBox "This Ball Mill does not exist!"
End If
MsgBox "You are starting the inspection of Ball Mill " & BallMillNumber
Dim vSheet As Worksheet
Set vSheet = Sheets("BM " & BallMillNumber)
With vSheet
Dim sourceCol As Integer, rowCount As Integer, currentRow As Integer
Dim currentRowValue As String
sourceCol = 2 'column B has a value of 2
rowCount = Cells(Rows.Count, sourceCol).End(xlUp).Row 'for every row, find the first blank cell
For currentRow = 7 To rowCount Step 2
currentRowValue = Cells(currentRow, sourceCol).Value
If IsEmpty(currentRowValue) Or currentRowValue = "" Then
Cells(currentRow, sourceCol) = InputBox("Enter Date")
End If
Next
End With
End Sub