Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid cell reference Grey Old Man[_2_] Excel Discussion (Misc queries) 1 April 26th 10 02:47 PM
Invalid Cell Reference error Ravi Excel Worksheet Functions 3 August 19th 08 09:47 PM
#REF! - Invalid Cell Reference Errors Techdewd49 Setting up and Configuration of Excel 1 April 21st 08 12:15 AM
Breaking links leaving invalid reference #REF! in cell Kenny Boy Excel Discussion (Misc queries) 1 October 28th 07 04:11 PM
How do I fix an Invalid Reference? Nic New Users to Excel 1 June 1st 06 04:43 PM


All times are GMT +1. The time now is 10:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"