Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Syntax when referring to self

General syntax question:

This does not work:

With Cell_Object
If .Value = 0 And Not(IsEmpty(.) Then .EntireRow.Delete Shift:=xlUp
End With 'Cell_Object

I am looking for a general way to refer to the object that is the subject of
the "With ..." statement within that "With .." "loop".
In the above example it would be substituted for the "." contained within
the "IsEmpty() expression.
But that is just an example and I am looking for a general method.

I tried Not(IsEmpty(.me)) but whilst that compiled OK it failed on run time
(error 438, does not support property or method)

Thanks

--
Return email address is not as DEEP as it appears


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Syntax when referring to self

Try:

IsEmpty(.Value)

IsEmpty takes a literal value or a pointer i.e variable name or object like
ActiveCell.

"Jack Schitt" wrote:

General syntax question:

This does not work:

With Cell_Object
If .Value = 0 And Not(IsEmpty(.) Then .EntireRow.Delete Shift:=xlUp
End With 'Cell_Object

I am looking for a general way to refer to the object that is the subject of
the "With ..." statement within that "With .." "loop".
In the above example it would be substituted for the "." contained within
the "IsEmpty() expression.
But that is just an example and I am looking for a general method.

I tried Not(IsEmpty(.me)) but whilst that compiled OK it failed on run time
(error 438, does not support property or method)

Thanks

--
Return email address is not as DEEP as it appears



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Syntax when referring to self

Jack Schitt wrote:

General syntax question:

This does not work:

With Cell_Object
If .Value = 0 And Not(IsEmpty(.) Then .EntireRow.Delete Shift:=xlUp
End With 'Cell_Object

I am looking for a general way to refer to the object that is the subject of
the "With ..." statement within that "With .." "loop".
In the above example it would be substituted for the "." contained within
the "IsEmpty() expression.
But that is just an example and I am looking for a general method.

I tried Not(IsEmpty(.me)) but whilst that compiled OK it failed on run time
(error 438, does not support property or method)

Thanks


Why doesn't .Value = 0 already negate IsEmpty(Cell_Object)?

Alan Beban
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Syntax when referring to self

VBA sees an empty cell as something that can be used as numeric 0.

kind of like =a1 returns a 0 if the A1 is empty.

Alan Beban wrote:

Jack Schitt wrote:

General syntax question:

This does not work:

With Cell_Object
If .Value = 0 And Not(IsEmpty(.) Then .EntireRow.Delete Shift:=xlUp
End With 'Cell_Object

I am looking for a general way to refer to the object that is the subject of
the "With ..." statement within that "With .." "loop".
In the above example it would be substituted for the "." contained within
the "IsEmpty() expression.
But that is just an example and I am looking for a general method.

I tried Not(IsEmpty(.me)) but whilst that compiled OK it failed on run time
(error 438, does not support property or method)

Thanks


Why doesn't .Value = 0 already negate IsEmpty(Cell_Object)?

Alan Beban


--

Dave Peterson

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
Referring a cell Terry0928 via OfficeKB.com Excel Discussion (Misc queries) 3 May 21st 10 09:22 AM
Referring to Cells PeterM Excel Discussion (Misc queries) 4 May 30th 08 02:37 PM
Referring to a hyperlink [email protected] Excel Discussion (Misc queries) 2 March 1st 06 02:11 PM
referring a worksheet lazmanyak Excel Worksheet Functions 1 July 23rd 05 02:55 PM
Referring Date in VBA anupam[_3_] Excel Programming 1 August 26th 04 01:10 PM


All times are GMT +1. The time now is 05:46 AM.

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

About Us

"It's about Microsoft Excel"