osborne
New Member
- Joined
- Jan 18, 2021
- Messages
- 2
- Office Version
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
Hi all. Need help on the following. I would like to write a code that if any cell in column AP has comment, it will prompt a msg box saying has comment. If no comment in any cell in column AP, it will prompt a msgbox saying no comment. As long as any cell in the column AP has comment, it will stop the loop. Somehow i feel it cannot use range. Pls help all the vba expert. Thank u in advance!
lastrow = Range("AP" & Rows.Count).End(xlUp).Row
If Range("AS4:AS" & lastrow).Comment Then
MsgBox "Has comment"
Else
MsgBox "no comment."
End If
lastrow = Range("AP" & Rows.Count).End(xlUp).Row
If Range("AS4:AS" & lastrow).Comment Then
MsgBox "Has comment"
Else
MsgBox "no comment."
End If