Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » Classic Visual Basic (VB 6 or earlier) » VBA(Excel, Word, etc...) » Testing for blank and/or empty rows or...


Testing for blank and/or empty rows or...Expand / Collapse
Author
Message
Posted 12/26/2009 7:08:40 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/3/2010 12:16:55 AM
Posts: 1, Visits: 5
I wish to loop through each row of a set area of a worksheet and delete only those rows which have nothing stored, regardless of whether they have never been used, or, if they once had contents in a cell/s that have since been cleared.  If any cell in the row has had its formatting altered or anything, I still wish it to be considered empty; as long as there is no formula or entry in a cell, I want it detected to be deleted.

1.  My text has the line

If IsEmpty(Range("A1")) then ....

which will test only if a particular cell is empty.

If I try

If IsEmpty(rows(1)) then

there is no compile error, but, if row 1 (1) has nothing in any cell, it still won't match if I have nothing in row 1 of the worksheet.

2.  What is the difference between somthing being empty or something being null?  I have tried other codes with null to try to detect empty lines, but they've caused run errors or again logical ones.

Many thanks to anyone who can assist :-)

Post #28584
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin, Mod

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 6:54pm