I don't think that's what he's looking for.
 
the .SaveAS is a workBOOK method, not a workSHEET method.
 
So, running this macro will save ALL sheets to the new workbook, using the 
sheet name as the new filename.
 
(it works because the "default" workbook for the Activesheet property is the 
Active Workbook)
 
I think what you need is:
 

ActiveSheet.Copy
ActiveWorkbook.SaveAs _
    FileName:="C:\temp\" & ActiveSheet.Name & ".xlsx", _
    FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
 
You'll have to change the fileformat to match the fileformat of your file.
 
the easiest way to figure this out is to record a macro in which you copy a 
sheet to a new workbook, save it as a new filename and type and close the 
workbook.
 

Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------

 From: Anil Gawli <gawlianil8...@gmail.com>
>To: "excel-macros@googlegroups.com" <excel-macros@googlegroups.com>; Rupesh 
>Patil <patil.rupesh1...@gmail.com> 
>Sent: Thursday, September 11, 2014 3:29 AM
>Subject: Re: $$Excel-Macros$$ save active sheet in new workbook
>  
>
>Dear Rupesh,
>
>Write below code in a module.
>
>Dim b As String
>ActiveSheet.Name = b
>Activesheet.SaveAs Filename:="C:\HarshadMacro\" & b & ".xlsx"
>Workbooks(b & ".xlsx").Close
>
>On Thu, Sep 11, 2014 at 12:05 PM, Rupesh Patil
><patil.rupesh1...@gmail.com> wrote:
>> Hello Expert,
>>
>> I need your help.
>> I need VBA Macro.
>>  How to save active sheet to new workbook with same sheet name in specific
>> location.
>>
>> --
>> Thanks & Regards,
>> Rupesh Patil,
>>
>>
>> --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
>> not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>-- 
>Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
>=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>https://www.facebook.com/discussexcel
>
>FORUM RULES
>
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
>2) Don't post a question in the thread of another member.
>3) Don't post questions regarding breaking or bypassing any security measure.
>4) Acknowledge the responses you receive, good or bad.
>5) Jobs posting is not allowed.
>6) Sharing copyrighted material and their links is not allowed.
>
>NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
>members are not responsible for any loss.
>--- 
>You received this message because you are subscribed to the Google Groups "MS 
>EXCEL AND VBA MACROS" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to excel-macros+unsubscr...@googlegroups.com.
>To post to this group, send email to excel-macros@googlegroups.com.
>Visit this group at http://groups.google.com/group/excel-macros.
>For more options, visit https://groups.google.com/d/optout.
>
>    

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to