LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default how to test if range object target deleted

I did the following:
Sub test()
Dim cell As Range
Set cell = ActiveCell
ActiveCell.EntireRow.Delete
If cell Is Nothing Then
MsgBox "row deleted"
Else
MsgBox "cell variable is not nothing!"
End If
End Sub

The answer I got was "cell variable is not nothing!".

Question: how to check for the variable cell no longer existing? I know I
can do the following:

dim anyS as string
on error resume next
anys =""
anys = cell.address
on error goto 0
if anys ="" then
msgbox "cell is nothing"
end if

But there should be a cleaner way! Excel 2003

Bob


 
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
Checking if the TARGET has been deleted Peter Rooney Excel Programming 0 February 1st 06 10:51 AM
Just a test message to be deleted Bosko Excel Worksheet Functions 1 November 3rd 05 10:06 AM
Target As Excel.Range or Target As Range Piranha[_5_] Excel Programming 2 June 3rd 05 03:49 PM
Ranges:Target in Worksheet_SelectionChange(ByVal Target As Range) Kevin McCartney Excel Programming 3 April 15th 05 01:51 PM
How find if target is object in Worksheet_Change (ByVal Target As.. ?) Gunnar Johansson Excel Programming 3 July 1st 04 09:25 PM


All times are GMT +1. The time now is 12:35 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"