PC Review


Reply
Thread Tools Rate Thread

Code for Deleting all but first row

 
 
Scott
Guest
Posts: n/a
 
      9th Oct 2008
I have a large data file that changes daily. I have a header row and am using
a filter to copy certain data including the header row to a new worksheet. I
want to then go back and delete all the data that was displayed by the filter
except for the Header row. Does anyone know the code that can do this??
 
Reply With Quote
 
 
 
 
Jim Thomlinson
Guest
Posts: n/a
 
      9th Oct 2008
range(Range("B1"), cells(rows.count,
columns.count)).specialcells(xlCellTypeVisible).entirerow.delete
--
HTH...

Jim Thomlinson


"Scott" wrote:

> I have a large data file that changes daily. I have a header row and am using
> a filter to copy certain data including the header row to a new worksheet. I
> want to then go back and delete all the data that was displayed by the filter
> except for the Header row. Does anyone know the code that can do this??

 
Reply With Quote
 
Scott
Guest
Posts: n/a
 
      9th Oct 2008
Thanks Jim. That works great!!

"Jim Thomlinson" wrote:

> range(Range("B1"), cells(rows.count,
> columns.count)).specialcells(xlCellTypeVisible).entirerow.delete
> --
> HTH...
>
> Jim Thomlinson
>
>
> "Scott" wrote:
>
> > I have a large data file that changes daily. I have a header row and am using
> > a filter to copy certain data including the header row to a new worksheet. I
> > want to then go back and delete all the data that was displayed by the filter
> > except for the Header row. Does anyone know the code that can do this??

 
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
VBA Code for Deleting a Row christopher.margol@gmail.com Microsoft Excel Worksheet Functions 3 6th Sep 2007 03:23 PM
Will deleting a Form delete attached code? AND How to see ALL code in dB ? Mel Microsoft Access 2 30th Apr 2007 08:25 PM
Deleting Code from VBA =?Utf-8?B?Tm9lbWk=?= Microsoft Excel Misc 1 24th Jan 2006 08:55 AM
Deleting code =?Utf-8?B?QWppdA==?= Microsoft Excel Programming 3 18th Mar 2004 10:11 PM
Deleting code in a file with code.. KimberlyC Microsoft Excel Programming 0 3rd Mar 2004 06:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:57 PM.