I need to show a pop up message indicating that some information is missing in the table according to each column, e.g. if one cell is empty in column A then a pop up message will say 'please fill in the missing values in Column A', 'please fill in the missing values in Column B'...
LastRow = sht.Cells(sht.Rows.Count, StartCell.Column).End(xlUp).Row
LastColumn = sht.Cells(StartCell.Row, sht.Columns.Count).End(xlToLeft).Column
sht.Range(StartCell, sht.Cells(LastRow, LastColumn)).Select
For Each Cell In Selection
For Row = 1 To LastRow
If Cells(Row, 1).Value = "" Then
if isempty(Cells(Row,1).mergearea().Value = true
MsgBox "Please fill in the code"
End If
If Cells(Row, 2).Value = "" Then
MsgBox "Please fill in the description" & Row
End If
If Cells(Row, 8).Value = "" Then
MsgBox "Please fill in the discounting %" & Row
ElseIf Cells(Row, 8).Value <> ">36%" Then
Cells(Row, 8).Interior.ColorIndex = 4
End If
Next Row
Should I used for each cell in selection or for next loop? This code will be used as a template which means the number or rows are different each time depending how many 'code' items (column A) is listed, does the first 3 lines of code suffice to find out the last row of not empty cells?
When I execute the code there's always more pop up messages than the actual number of empty cells. It seems like I can't identify whether a merged cell is empty or not.
Lastly, I also need to see the value in the discounted column whether the valued inside the cells > 36%, if yes then the whole row is highlighted. How can I code that? Thanks a lot guys!