Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Error Message Once a Range is Activated | Excel Programming | |||
conditional formatting error message | Excel Worksheet Functions | |||
replace VBA run-time error message with custom message | Excel Programming | |||
Intercept/replace standard 'cell protected' message with my own message? | Excel Programming | |||
changing the message in an error message | Excel Worksheet Functions |