Hi All, I am new to VBA and also this forum, thanks for the help in advance
My intention is to have msgbox popup when
i. "Last Rows in Column C is LESS than Column A" = Additional Content Detected
ii. "Last Rows in Column C is MORE than Column A" = Redundant Row To Delete
I would like to confirm is the 2 or more msgbox can popup together? As I have another msgbox to check the error in the worksheet (e.g. #N/A)
Example as below
My codes (Not Working btw)
My intention is to have msgbox popup when
i. "Last Rows in Column C is LESS than Column A" = Additional Content Detected
ii. "Last Rows in Column C is MORE than Column A" = Redundant Row To Delete
I would like to confirm is the 2 or more msgbox can popup together? As I have another msgbox to check the error in the worksheet (e.g. #N/A)
Example as below
Column A | Column B | Column C (Formulas - vlookup) |
AA | 11 | '=VLOOKUP(A2,'Sheet2'!A:C,2,FALSE) |
BB | 22 | '=VLOOKUP(A3,'Sheet2'!A:C,2,FALSE) |
CC | 33 |
My codes (Not Working btw)
VBA Code:
Sub Msgbox()
Dim Alert2A, Alert2B as range
'To check additional rows
On Error Resume Next
Set Alert2A = Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row
Set Alert2B = Cells(ActiveSheet.Rows.Count, "C").End(xlUp).Row
On Error GoTo 0
If Alert2A < Alert2B Then
MsgBox "Redundant Rows To Delete"
Else
MsgBox "Additional Rows Detected"
Exit Sub
End If
End Sub