View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Macro Save with Worksheet as file Name

I don't know how to SaveAs pdf, but the following will SaveAs the sheet or
(tab) name:


Sub Macro1()
Dim s As String
s = ActiveCell.Worksheet.Name
ActiveWorkbook.SaveAs Filename:=s
End Sub

You do not need to spec. the directory if you are willing to save back from
whence you came.
--
Gary's Student


"bbkixx" wrote:

Hello-

I am trying to create a macro that will save a worksheet as a pdf, and
rename the file to the name of the selected worksheet. Now I have the saving
to pdf part down, but I can't seem to get the renaming of the filename to the
worksheet part down. Does anyone have some ideas how I can do this?

Any help will be greatly apperciated.

Thank you!
BBkixx