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!
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,388
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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?
 

adam18

New Member
Joined
Jun 22, 2015
Messages
22
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"
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,388
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,315
Members
414,053
Latest member
Dual Showman

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
Top