macro to copy a worksheet

P

phil

I know next tonothing about VB code, so I do alot of the macros with the
recorder. I would like to:
copy an exising worksheet, with the copy, delete entries in all cells
that have a color fill, then rename the new worksheet. A mesgbox would
display aking for the name of the coied worksheet. When the name is
entered and OK is pressed the there would be a new worksheet with the
new name.

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Business Software Galore!
Free Excel Forum http://www.ozgrid.com/forum ***
 
P

pauluk

The code for the copying of the worsheet then allowing the user to se
the name to which you want to save is below. As for deleting the row
which are a certain color not that sure

Sub CopyReName()
Dim StrName As String
Cells.Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Range("A1").Select

StrName = InputBox("Save File", "Save File")
ActiveWorkbook.SaveAs Filename:="C:\" & StrName
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False
_
CreateBackup:=False
End Su
 
P

pauluk

The code for the copying of the worsheet then allowing the user to set
the name to which you want to save is below. As for deleting the rows
which are a certain color not that sure

Sub CopyReName()
Dim StrName As String
Cells.Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Range("A1").Select

StrName = InputBox("Save File", "Save File")
ActiveWorkbook.SaveAs Filename:="C:\" & StrName,
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
_
CreateBackup:=False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top