ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ERROR MESSAGE ON CONDITIONAL MESSAGE (https://www.excelbanter.com/excel-programming/450751-error-message-conditional-message.html)

[email protected]

ERROR MESSAGE ON CONDITIONAL MESSAGE
 

Dear all,

I got error message while running the line below. What is the right rendering please?


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

Claus Busch

ERROR MESSAGE ON CONDITIONAL MESSAGE
 
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

[email protected]

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


Thanks Claus. will try it

[email protected]

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

GS[_2_]

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



Claus Busch

ERROR MESSAGE ON CONDITIONAL MESSAGE
 
Hi Kris,

Am Wed, 1 Apr 2015 03:32:29 -0700 (PDT) schrieb :

I tried it and got same error messages as below:

Run-time error '1004':


please post here the complete code


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


All times are GMT +1. The time now is 09:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com