View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ray Ray is offline
external usenet poster
 
Posts: 267
Default If-Then, with an OR --- not working!

Hello -

This piece of code isn't working for me and I have NO idea why not:

iLastRow = ws.Cells(Rows.Count, 2).End(xlUp).Row
If ws.Name < "Home" Or iLastRow < 8 Then
<other code here
End If
Next ws

'ws' is defined as Worksheet and iLastRow is defined as Integer.

So, if the name of the Sheet is 'Home' OR if the LastRow is less than
8, the code should continue on with the next sheet. It works fine if
Sheet.name = Home, but proceeds through the normal code if iLastRow<8
and doing so causes an error.

What's wrong with my coding?

TIA,
Ray