Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Non blank cells

Hello,

I need you help in resolving my error code. I would like to find the first
blank cell in colume A and then delete everything below it.

I tried this and it did not work.
Range(Range("A65536").End(xlUp)(2), Range("A65536")).EntireRow.Delete

Help is much appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Non blank cells

Thanks Don,
If I wanted to change the column to B, it would be Cells(2,1), right?

Thanks.
"Don Guillett" wrote:

Try this approach

Sub deleterowsbelowfirstblankcell()
fbr = Cells(1, 1).End(xlDown).Row + 1
'MsgBox fbr
lr = Cells(Rows.Count, 1).End(xlUp).Row + 1
'MsgBox lr
Rows(fbr).Resize(lr - fbr).Delete
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MrRJ" wrote in message
...
Hello,

I need you help in resolving my error code. I would like to find the
first
blank cell in colume A and then delete everything below it.

I tried this and it did not work.
Range(Range("A65536").End(xlUp)(2), Range("A65536")).EntireRow.Delete

Help is much appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Non blank cells

Don,
Thanks for your help earlier. I found a problem that just doesn't make
sense. I ran my macro with your code or anything similar. I watched it run
and then came to a halt, because of non blank cell error. Naturally, I ended
the code and manually tried to insert a column, and it didn't work.

NOW, after a several minutes later, I tried to insert the column and IT
WORKS! Wny is that? It makes no sense to me. Is it working behind the
scenes?

I hear a lot about screenupdating and calculation turning off. Would that
help. I do not have them in my code. If you think I need it, where should I
put them?

Thanks.

"Don Guillett" wrote:

Try this approach

Sub deleterowsbelowfirstblankcell()
fbr = Cells(1, 1).End(xlDown).Row + 1
'MsgBox fbr
lr = Cells(Rows.Count, 1).End(xlUp).Row + 1
'MsgBox lr
Rows(fbr).Resize(lr - fbr).Delete
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MrRJ" wrote in message
...
Hello,

I need you help in resolving my error code. I would like to find the
first
blank cell in colume A and then delete everything below it.

I tried this and it did not work.
Range(Range("A65536").End(xlUp)(2), Range("A65536")).EntireRow.Delete

Help is much appreciated.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Non blank cells

Don,
Thanks for your help earlier. I found a problem that just doesn't make
sense. I ran my macro without your code or anything similar. I watched it
run and then came to a halt, because of non blank cell error. Naturally, I
ended the code and manually tried to insert a column, and it didn't work.

NOW, after a several minutes later, I tried to insert the column and IT
WORKS! Wny is that? It makes no sense to me. Is it working behind the
scenes?

I hear a lot about screenupdating and calculation turning off. Would that
help. I do not have them in my code. If you think I need it, where should I
put them?

Thanks.


"MrRJ" wrote:

Don,
Thanks for your help earlier. I found a problem that just doesn't make
sense. I ran my macro with your code or anything similar. I watched it run
and then came to a halt, because of non blank cell error. Naturally, I ended
the code and manually tried to insert a column, and it didn't work.

NOW, after a several minutes later, I tried to insert the column and IT
WORKS! Wny is that? It makes no sense to me. Is it working behind the
scenes?

I hear a lot about screenupdating and calculation turning off. Would that
help. I do not have them in my code. If you think I need it, where should I
put them?

Thanks.

"Don Guillett" wrote:

Try this approach

Sub deleterowsbelowfirstblankcell()
fbr = Cells(1, 1).End(xlDown).Row + 1
'MsgBox fbr
lr = Cells(Rows.Count, 1).End(xlUp).Row + 1
'MsgBox lr
Rows(fbr).Resize(lr - fbr).Delete
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MrRJ" wrote in message
...
Hello,

I need you help in resolving my error code. I would like to find the
first
blank cell in colume A and then delete everything below it.

I tried this and it did not work.
Range(Range("A65536").End(xlUp)(2), Range("A65536")).EntireRow.Delete

Help is much appreciated.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Array Formula for Counting Blank & Non Blank Cells (Multiple Criteria) foofoo Excel Discussion (Misc queries) 3 February 20th 12 08:03 PM
Excel 2002: Return blank when VLOOKUP on blank cells Mr. Low Excel Discussion (Misc queries) 2 June 4th 09 05:12 PM
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Excel Worksheet Functions 5 November 3rd 07 08:21 AM
Start Cell B1 then find first blank cell, insert subtotal, next non blank, then next blank, sutotal cells in between......... [email protected][_2_] Excel Programming 2 June 7th 07 09:27 PM
Copy to first Blank cell in Colum C Non blank cells still exist be Ulrik loves horses Excel Programming 2 October 8th 06 07:35 PM


All times are GMT +1. The time now is 08:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"