ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I write a macro in XL that will delete 1st row and save th. (https://www.excelbanter.com/excel-programming/325542-how-do-i-write-macro-xl-will-delete-1st-row-save-th.html)

Nitin

How do I write a macro in XL that will delete 1st row and save th.
 
I would like to create a macro that deletes the the first row or the first
two rows and saves the file with a new predefined name and location.

Bob Phillips[_6_]

How do I write a macro in XL that will delete 1st row and save th.
 

With Activeworkbook
.Worksheets("Sheet1").Rows("1:2").Delete
.SaveAs Filename:= myFile
End With

where myFile is the predefined name.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nitin" wrote in message
...
I would like to create a macro that deletes the the first row or the first
two rows and saves the file with a new predefined name and location.





All times are GMT +1. The time now is 08:19 PM.

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