range objects

  • Thread starter Thread starter damonh
  • Start date Start date
D

damonh

Hey,

If I set a range object as referring to the cell A1 in a
spreadsheet and then delete the first column, will the
object reference be deleted or will the object still point
to A1?

Thanks in advance

damonh
 
Hi Damon,

Absolutely not, the range object will not be valid once the column is
deleted.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi Damonh,
If I set a range object as referring to the cell A1 in a
spreadsheet and then delete the first column, will the
object reference be deleted or will the object still point
to A1?

In Excel XP the object will be destroyed.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com
 
Completely accept what you say but could you clarify
the "but what is it" in the following

Sub test()
Set r = Range("a1")
Columns(1).Delete
'r.Select 'fails
MsgBox Not r Is Nothing 'true but what is it?
Set r = Nothing
MsgBox Not r Is Nothing
End Sub

Thanks,
Dan
 
r is a variable that is not nothing, but is not a valid object either, so it
is returning 'Object required'

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Uhm, so it's something of nothing :-)

Dan
-----Original Message-----
r is a variable that is not nothing, but is not a valid object either, so it
is returning 'Object required'

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)




.
 
No that is what it is not, nothing is a something in objects<vbg>

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top