PC Review


Reply
Thread Tools Rate Thread

Count of rows with nulls

 
 
tbmarlie
Guest
Posts: n/a
 
      22nd Oct 2007
I've created code previously where I deleted rows based on certain
criteria being found in that row. In doing so I had the code below
that did a count of rows in column a. This code assumed that there
were no blank cells in column a. How would I change this code if I
don't have any columns in my data where there are no blank cell?.

For k = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
If Cells(k, "a") = "GMEIS" Then Rows(k).EntireRow.Delete
Next k

Thanks

 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2VhbkMgVUs=?=
Guest
Posts: n/a
 
      22nd Oct 2007
Hi tbmarlie,

I'm not entirely sure what you are trying to do. You say "How would I change
this code if I don't have any columns in my data where there are no blank
cell?" So you are saying what if you DO have columns WITH blank cells. As far
as I can see your current code will delete rows that contain "GMEIS" in
column A, and should work if there are blank cells in column.

If you could help me to understand better what you are trying to achieve I
will do my best to help.

Sean.


--
(please remember to click yes if replies you receive are helpful to you)


"tbmarlie" wrote:

> I've created code previously where I deleted rows based on certain
> criteria being found in that row. In doing so I had the code below
> that did a count of rows in column a. This code assumed that there
> were no blank cells in column a. How would I change this code if I
> don't have any columns in my data where there are no blank cell?.
>
> For k = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
> If Cells(k, "a") = "GMEIS" Then Rows(k).EntireRow.Delete
> Next k
>
> Thanks
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Totals Won't Count Nulls jgraves Microsoft Access Queries 1 7th Jan 2010 06:17 PM
Count Nulls & Not Nulls in Reports RoadKill Microsoft Access Reports 2 28th Jul 2008 06:16 PM
Using Count in a Report with Nulls =?Utf-8?B?YXJpYQ==?= Microsoft Access 1 13th Sep 2005 10:34 PM
Need to Count Nulls marywoody Microsoft Access Queries 1 22nd Jan 2004 09:27 AM
Count nulls Razor Microsoft Access Queries 1 9th Dec 2003 02:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:34 PM.