ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Look for Errors (https://www.excelbanter.com/excel-programming/357984-look-errors.html)

Steph

Look for Errors
 
Hi. Is there a way to scan all of column G looking for formula errors (ie
#N/A), and return a message box with the cell address of all cells with
errors? Thanks!



Papou

Look for Errors
 
Hello
Please amend accordingly
Sub VerifErreurs()
Dim Msg$
For Each cellule In Range("G1:G20")
If cellule.HasFormula Then
If IsError(cellule) Then
Msg = Msg & vbLf & cellule.Address
End If
End If
Next cellule
MsgBox Msg, vbInformation, "Errors summary"
End Sub

HTH
Cordially
Pascal

"Steph" a écrit dans le message de news:
...
Hi. Is there a way to scan all of column G looking for formula errors (ie
#N/A), and return a message box with the cell address of all cells with
errors? Thanks!




Papou

Look for Errors
 
Apologies!
You might as well add this little test just in case no errors were found:
Sub VerifErreurs()
Dim Msg$
For Each cellule In Range("G1:G20")
If cellule.HasFormula Then
If IsError(cellule) Then
Msg = Msg & vbLf & cellule.Address
End If
End If
Next cellule
Select Case Msg
Case Is < ""
MsgBox Msg, vbInformation, "Errors summary"
Case Else: MsgBox "no errors found in specified range", vbInformation,
"Errors summary"
End Select
End Sub

HTH
Cordially
Pascal
"papou" <cestpasbon@çanonplus a écrit dans le message de news:
...
Hello
Please amend accordingly
Sub VerifErreurs()
Dim Msg$
For Each cellule In Range("G1:G20")
If cellule.HasFormula Then
If IsError(cellule) Then
Msg = Msg & vbLf & cellule.Address
End If
End If
Next cellule
MsgBox Msg, vbInformation, "Errors summary"
End Sub

HTH
Cordially
Pascal

"Steph" a écrit dans le message de news:
...
Hi. Is there a way to scan all of column G looking for formula errors
(ie #N/A), and return a message box with the cell address of all cells
with errors? Thanks!






Steph

Look for Errors
 
Thank you so much!!

"papou" <cestpasbon@çanonplus wrote in message
...
Apologies!
You might as well add this little test just in case no errors were found:
Sub VerifErreurs()
Dim Msg$
For Each cellule In Range("G1:G20")
If cellule.HasFormula Then
If IsError(cellule) Then
Msg = Msg & vbLf & cellule.Address
End If
End If
Next cellule
Select Case Msg
Case Is < ""
MsgBox Msg, vbInformation, "Errors summary"
Case Else: MsgBox "no errors found in specified range", vbInformation,
"Errors summary"
End Select
End Sub

HTH
Cordially
Pascal
"papou" <cestpasbon@çanonplus a écrit dans le message de news:
...
Hello
Please amend accordingly
Sub VerifErreurs()
Dim Msg$
For Each cellule In Range("G1:G20")
If cellule.HasFormula Then
If IsError(cellule) Then
Msg = Msg & vbLf & cellule.Address
End If
End If
Next cellule
MsgBox Msg, vbInformation, "Errors summary"
End Sub

HTH
Cordially
Pascal

"Steph" a écrit dans le message de news:
...
Hi. Is there a way to scan all of column G looking for formula errors
(ie #N/A), and return a message box with the cell address of all cells
with errors? Thanks!









All times are GMT +1. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com