View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default ERROR MESSAGE ON CONDITIONAL MESSAGE

On Tuesday, March 31, 2015 at 4:13:03 PM UTC+1, Claus Busch wrote:
Hi Kris,

Am Tue, 31 Mar 2015 08:05:03 -0700 (PDT) schrieb
:

If Range("A" & z - 1).Value = "" And Range("A" & z - 2).Value = ""
Then


I prefer to check the length of a cell:
If Len(Range("A" & z - 1)) = 0 And Len(Range("A" & z - 2)) = 0 Then

But your syntax works also well if z is larger than 2


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


I tried it and got same error messages as below:

Run-time error '1004':
Method 'Range' of object'_Global' failed


The minimum z can be for this to work is 3, to ensure the lowest
address is A1. Otherwise, any value less than 1 will fail!

--
Garry

Free usenet access at
http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion