ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Delete all Rows Macro (https://www.excelbanter.com/excel-discussion-misc-queries/133516-delete-all-rows-macro.html)

Wanna Learn

Delete all Rows Macro
 
Hello I need a macro to delete all rows except row 1 thanks

Wanna Learn

Delete all Rows Macro
 
Me again ... What I need is a macro to delete all rows except row 1 and also
delete all formating e.g. borders, patterns thanks again
"Wanna Learn" wrote:

Hello I need a macro to delete all rows except row 1 thanks


Don Guillett

Delete all Rows Macro
 
good up until xl2007. SAVE workbook.

Sub deleteallrowsbut1()
Rows("2:65536").Delete
End Sub


--
Don Guillett
SalesAid Software

"Wanna Learn" wrote in message
...
Hello I need a macro to delete all rows except row 1 thanks




Sandy Mann

Delete all Rows Macro
 
Don,

Out of interest, (assuming you have XL2007), would:

Sub AllButOne()
Rows("2:" & Rows.Count).Delete
End Sub

work in all versions?

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Don Guillett" wrote in message
...
good up until xl2007. SAVE workbook.

Sub deleteallrowsbut1()
Rows("2:65536").Delete
End Sub


--
Don Guillett
SalesAid Software

"Wanna Learn" wrote in message
...
Hello I need a macro to delete all rows except row 1 thanks






Don Guillett

Delete all Rows Macro
 

I do have xl2007 courtesy of special MicroSoft introduction but still in the
box until I get a new computer.
I assume that would work but there sure are a lot of rows....
--
Don Guillett
SalesAid Software

"Sandy Mann" wrote in message
...
Don,

Out of interest, (assuming you have XL2007), would:

Sub AllButOne()
Rows("2:" & Rows.Count).Delete
End Sub

work in all versions?

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Don Guillett" wrote in message
...
good up until xl2007. SAVE workbook.

Sub deleteallrowsbut1()
Rows("2:65536").Delete
End Sub


--
Don Guillett
SalesAid Software

"Wanna Learn" wrote in message
...
Hello I need a macro to delete all rows except row 1 thanks








Sandy Mann

Delete all Rows Macro
 

Thank you Don.
--


Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Don Guillett" wrote in message
...

I do have xl2007 courtesy of special MicroSoft introduction but still in
the box until I get a new computer.
I assume that would work but there sure are a lot of rows....
--
Don Guillett
SalesAid Software

"Sandy Mann" wrote in message
...
Don,

Out of interest, (assuming you have XL2007), would:

Sub AllButOne()
Rows("2:" & Rows.Count).Delete
End Sub

work in all versions?

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Don Guillett" wrote in message
...
good up until xl2007. SAVE workbook.

Sub deleteallrowsbut1()
Rows("2:65536").Delete
End Sub


--
Don Guillett
SalesAid Software

"Wanna Learn" wrote in message
...
Hello I need a macro to delete all rows except row 1 thanks










All times are GMT +1. The time now is 07:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com