macro to copy a worksheet

  • Thread starter Thread starter phil
  • Start date Start date
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 ***
 
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
 
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
 
Back
Top