View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default How to save a single worksheet as worksheet name in new folder??

on Error Resume Next
Mkdir "M:\Statistics"
On Error goto 0
Activesheet.copy
sName = "M:\Statistics\" & _
Activesheet.Name & ".xls"
Activeworkbook.SaveAs sName , xlWorkbook.Normal, _
ReadOnlyRecommended:=True
Activeworkbook.Close SaveChanges:=False

--
Regards,
Tom Ogilvy


"Simon Lloyd" wrote:


Hi all,

Can anyone tell me how in vba to save a single worksheet as the
worksheets name in a new folder called statistics on the desktop or in
my documents but if the folder does not exist create it first?

Rather than save all my statistic worksheets in the workbook they were
generated in i would like to save them as a read only worksheet in
another folder, this way people can view or copy from an area where
they can have no direct influence on the workbook that created them.

Any ideas?

Regards,

Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=542456