Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro that Deletes All rows except first row


Greetings everyone!

How can I delete all rows in an excel sheet except the first row?

I have an excel sheet where the first row has header information and
the subsequent rows contains data. I would like to run a vba macro that
clears/delete all the data , starting from row 2, in the excel sheet but
retains the header information in row 1.

Curtney Jacobs


--
curtney
------------------------------------------------------------------------
curtney's Profile: http://www.excelforum.com/member.php...o&userid=36469
View this thread: http://www.excelforum.com/showthread...hreadid=562327

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro that Deletes All rows except first row


Rows(1).Offset(1, 0).Resize(Rows.Count - 1).ClearContent

--
Kaa
-----------------------------------------------------------------------
Kaak's Profile: http://www.excelforum.com/member.php...nfo&userid=751
View this thread: http://www.excelforum.com/showthread.php?threadid=56232

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro that Deletes All rows except first row


Thanks, that did the trick! All the rows get deleted from row 2
onwards!

Is there a way to reset the active cell back to the second row after
deletion? Meaning the active row/cell should be the second row again.

Thanks,

Curtney


--
curtney
------------------------------------------------------------------------
curtney's Profile: http://www.excelforum.com/member.php...o&userid=36469
View this thread: http://www.excelforum.com/showthread...hreadid=562327

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
Macro that deletes rows from cell containing End to end of data. Richard Excel Discussion (Misc queries) 2 July 25th 07 03:51 PM
Macro that deletes certain rows only supamari0 Excel Programming 7 June 9th 06 04:11 PM
Why xl deletes 250+ rows using worksheet_change stumanchu Excel Programming 2 April 24th 06 08:41 PM
Help With a Loop That Deletes Rows Vecchia Excel Programming 5 November 21st 05 10:04 PM
Macro that deletes certain rows and not others Roger[_20_] Excel Programming 8 May 3rd 05 12:02 AM


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