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.
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.
Hello Nitin,
To delete a given row by it's row number...
Activesheet.Rows(1).Delete (This delete row 1 on the active sheet)
To Save the Workbook to New Location...
'Save the Current Directory
OldDir = CurDir
'Change Directory to Our New Location
ChDir("C:\Program Files\New Folder\")
'Save the Workbook
Workbook.Save
'Restore Original Directory
ChDir(OldDir)
Hope this helps,
Leith Ross
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" <[email protected]> wrote in message
news:[email protected]...
> 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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks