I've designed excel file for showing pending task. I want msgbox dimension to fit with only rows which have blank cell on column "F", but msgbox dimension is fit with 100 as i in my code
Sub Pending()
Dim r As Long
Dim msg As String, i As Long, a As Variant
msg = ""
For i = 2 To 100
For Each a In Array("F")
If Range("E" & i) <> "" And Cells(i, a).Value = "" Then
msg = msg & Range("D" & i) & " " & Range("E" & i) & Cells(i, a).Value & vbTab
End If
Next a
msg = msg & vbCrLf
Next i
MsgBox msg
End Sub
Sub Pending()
Dim r As Long
Dim msg As String, i As Long, a As Variant
msg = ""
For i = 2 To 100
For Each a In Array("F")
If Range("E" & i) <> "" And Cells(i, a).Value = "" Then
msg = msg & Range("D" & i) & " " & Range("E" & i) & Cells(i, a).Value & vbTab
End If
Next a
msg = msg & vbCrLf
Next i
MsgBox msg
End Sub
