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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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