Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Delete and Move Up

Hi...

I have 3000 records. In column B, some cells are reading #N/A. I need some
code that will delete the rows where the #N/A occours and leave no gaps. So
by the time I'm through I have say 2800 records with no gaps in the rows? Is
this possible?

Thanks

Gordon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Delete and Move Up


On your active row try this....


Selection.Delete Shift:=xlUp

Louis Markham

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Delete and Move Up

Hi Gordon,

If no other error present, the you can use (save before testing)
Columns("B:B").SpecialCells(xlCellTypeFormulas,
xlErrors).EntireRow.Delete
Else loop, delete the N/A then
Columns("B:B").SpecialCells(xlblanks).EntireRow.De lete
Regards
JY

"Gordon" wrote in message
...
Hi...

I have 3000 records. In column B, some cells are reading #N/A. I need some
code that will delete the rows where the #N/A occours and leave no gaps.
So
by the time I'm through I have say 2800 records with no gaps in the rows?
Is
this possible?

Thanks

Gordon



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Delete and Move Up

Jean...

I'm not too hot on the rules that govern the building of workable macros,
though I know how they work when I see them - bit like learning a foreign
language.

Could you wrap this up for me so it will work.

Thanks in advance.

Gordon...

"Jean-Yves" wrote:

Hi Gordon,

If no other error present, the you can use (save before testing)
Columns("B:B").SpecialCells(xlCellTypeFormulas,
xlErrors).EntireRow.Delete
Else loop, delete the N/A then
Columns("B:B").SpecialCells(xlblanks).EntireRow.De lete
Regards
JY

"Gordon" wrote in message
...
Hi...

I have 3000 records. In column B, some cells are reading #N/A. I need some
code that will delete the rows where the #N/A occours and leave no gaps.
So
by the time I'm through I have say 2800 records with no gaps in the rows?
Is
this possible?

Thanks

Gordon




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Delete and Move Up

sub test
This use the xl function IsNA, if true, clear cell content

Dim rng as range
for each rng in range("B2",range("B2")).end(xldown)
if application.WorksheetFunction.IsNA(range) then rng.clear
next
Columns("B:B").SpecialCells(xlCellTypeBlanks).Enti reRow.Delete
end sub
Nice WE (*I go home now*)
Regards
JY
"Gordon" wrote in message
...
Jean...

I'm not too hot on the rules that govern the building of workable macros,
though I know how they work when I see them - bit like learning a foreign
language.

Could you wrap this up for me so it will work.

Thanks in advance.

Gordon...

"Jean-Yves" wrote:

Hi Gordon,

If no other error present, the you can use (save before testing)
Columns("B:B").SpecialCells(xlCellTypeFormulas,
xlErrors).EntireRow.Delete
Else loop, delete the N/A then
Columns("B:B").SpecialCells(xlblanks).EntireRow.De lete
Regards
JY

"Gordon" wrote in message
...
Hi...

I have 3000 records. In column B, some cells are reading #N/A. I need
some
code that will delete the rows where the #N/A occours and leave no
gaps.
So
by the time I'm through I have say 2800 records with no gaps in the
rows?
Is
this possible?

Thanks

Gordon






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
Selecting every other row to delete or move Jeanne Excel Discussion (Misc queries) 1 April 8th 06 01:53 AM
How do I set up an automatic delete or move of a row of data? Zo Excel Discussion (Misc queries) 4 November 24th 05 08:35 PM
Button to move row and delete old row Stacie Fugate[_2_] Excel Programming 12 January 27th 05 09:25 PM
Move text after delete gregork Excel Programming 3 December 9th 04 09:20 AM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 02:41 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"