![]() |
detect invalid cell reference
This message shows on cell while moving cursor over to it: "Moving or deleting cells caused an invalid cell reference, or functio is returning reference error" and in cell, value is somewhat like this: "#REF!" In my vba automation program due to this it halts on this point wit END or DEBUG message box. I need to detect this type of value to display error msgbox instea halting with debug. In my activesheet, detect this type of value containing in cell -- ilyaskaz ----------------------------------------------------------------------- ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396 View this thread: http://www.excelforum.com/showthread.php?threadid=39553 |
detect invalid cell reference
Iyaskazi,
If you are performing an action one cell at a time, you can test for the "#REF!" and skip if necessary, for example: Sub test() Dim cell As Range For Each cell In Range("A1:A10") If InStr(1, cell.Text, "#REF") = 0 Then cell.Value = cell.Value + 1 End If Next cell End Sub hth, Doug "ilyaskazi" wrote in message ... This message shows on cell while moving cursor over to it: "Moving or deleting cells caused an invalid cell reference, or function is returning reference error" and in cell, value is somewhat like this: "#REF!" In my vba automation program due to this it halts on this point with END or DEBUG message box. I need to detect this type of value to display error msgbox instead halting with debug. In my activesheet, detect this type of value containing in cell. -- ilyaskazi ------------------------------------------------------------------------ ilyaskazi's Profile: http://www.excelforum.com/member.php...o&userid=23969 View this thread: http://www.excelforum.com/showthread...hreadid=395536 |
All times are GMT +1. The time now is 01:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com