Macro: Help creating pop-up box if column has certain word!!

adam18

New Member
Joined
Jun 22, 2015
Messages
22
Excel Macro question:

Can you help me out creating a pop-up box that says "Choose other" if Column F has the word "#N/A"?

Thanks!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Excel Macro question:

Can you help me out creating a pop-up box that says "Choose other" if Column F has the word "#N/A"?

Thanks!
Please clarify. You want a pop-up if a cell in col F is selected and contains the error #N/A? If yes, is that error being returned by a formula in the cell?
 
Upvote 0
Thanks for replying!


Sorry about the wording.

Basically I want to check the entire column F. Then if the column contains the word "#N/A", I want a pop-up box that has the message "error"
 
Upvote 0
Thanks for replying!


Sorry about the wording.

Basically I want to check the entire column F. Then if the column contains the word "#N/A", I want a pop-up box that has the message "error"
You didn't answer my question as to whether the error, if any, is being returned by a formula so I'll assume it is.
Code:
Sub Adam18()
Dim c As Range
On Error Resume Next
With Intersect(Range("F:F"), ActiveSheet.UsedRange)
    For Each c In .SpecialCells(xlCellTypeFormulas, xlErrors)
        On Error GoTo 0
        If c Is Nothing Then Exit Sub
        If c.Value = CVErr(xlErrNA) Then
            MsgBox "error"
            Exit For
        End If
    Next c
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,739
Messages
6,174,217
Members
452,551
Latest member
croud

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top