+ Reply to Thread
Results 1 to 5 of 5

macro to save new file (same as tab name)

  1. #1
    Brian Thompson via OfficeKB.com
    Guest

    macro to save new file (same as tab name)

    Hi

    I am recording macro and want to save the new macro- recorded sheet as the
    same name as the sheet tab.
    I do have the tab name in one of the cells A1, using =cell("filename",A1)
    Example : sheet name week1, want to save new file as week1

    I Can copy and paste into existing macro
    thanks in advance

    brian

    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...l-new/200601/1

  2. #2
    Bob Phillips
    Guest

    Re: macro to save new file (same as tab name)

    Activeworkbook.SaveAs Filename:=Activesheet.Name

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "Brian Thompson via OfficeKB.com" <u15682@uwe> wrote in message
    news:5b0b093bf4676@uwe...
    > Hi
    >
    > I am recording macro and want to save the new macro- recorded sheet as the
    > same name as the sheet tab.
    > I do have the tab name in one of the cells A1, using =cell("filename",A1)
    > Example : sheet name week1, want to save new file as week1
    >
    > I Can copy and paste into existing macro
    > thanks in advance
    >
    > brian
    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.a...l-new/200601/1




  3. #3
    Brian Thompson via OfficeKB.com
    Guest

    Re: macro to save new file (same as tab name)

    thanks, it worked, however, I do reqiure to save the acutal sheet the i'm
    viewing. In the example below i was in sheet3.


    What code do I replace line 3 and 4 to save the actual sheet i'm viewing
    before running the macro?

    example of pary recorded macro
    ActiveCell.FormulaR1C1 = "3"
    Range("E11").Select
    Sheets("Sheet3").Select
    Sheets("Sheet3").Copy
    Range("E14").Select
    Sheets("Sheet3").Select
    ActiveWorkbook.SaveAs Filename:= _



    Bob Phillips wrote:
    >Activeworkbook.SaveAs Filename:=Activesheet.Name
    >
    >--
    >
    >HTH
    >
    >Bob Phillips
    >
    >(remove nothere from the email address if mailing direct)
    >
    >> Hi
    >>

    >[quoted text clipped - 7 lines]
    >>
    >> brian


    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...l-new/200601/1

  4. #4
    Bob Phillips
    Guest

    Re: macro to save new file (same as tab name)

    What exactly do you mean by save the sheet? Normally, one saves a workbook,.
    a sheet is part, but not all , of a workbook.

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "Brian Thompson via OfficeKB.com" <u15682@uwe> wrote in message
    news:5b1503c1e5469@uwe...
    > thanks, it worked, however, I do reqiure to save the acutal sheet the i'm
    > viewing. In the example below i was in sheet3.
    >
    >
    > What code do I replace line 3 and 4 to save the actual sheet i'm viewing
    > before running the macro?
    >
    > example of pary recorded macro
    > ActiveCell.FormulaR1C1 = "3"
    > Range("E11").Select
    > Sheets("Sheet3").Select
    > Sheets("Sheet3").Copy
    > Range("E14").Select
    > Sheets("Sheet3").Select
    > ActiveWorkbook.SaveAs Filename:= _
    >
    >
    >
    > Bob Phillips wrote:
    > >Activeworkbook.SaveAs Filename:=Activesheet.Name
    > >
    > >--
    > >
    > >HTH
    > >
    > >Bob Phillips
    > >
    > >(remove nothere from the email address if mailing direct)
    > >
    > >> Hi
    > >>

    > >[quoted text clipped - 7 lines]
    > >>
    > >> brian

    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.a...l-new/200601/1




  5. #5
    Brian Thompson via OfficeKB.com
    Guest

    Re: macro to save new file (same as tab name)

    Hi Bob

    Will save workbook in usual way. then will copy sheet, paste special, format
    and then save as the tab name. This new sheet(wkbook) will then be sent via
    mail.

    The last line does work, however, only keeps saving "sheet3"

    What do I replace "Sheet3" (see below) with to save selected sheet I am
    veiwing at the time

    Sheets("Sheet3").Select
    Range("A1").Select
    ActiveWorkbook.SaveAs Filename:=ActiveSheet.Name

    thanks for your patience !

    regards

    Brian

    Bob Phillips wrote:
    >What exactly do you mean by save the sheet? Normally, one saves a workbook,.
    >a sheet is part, but not all , of a workbook.
    >
    >--
    >
    >HTH
    >
    >Bob Phillips
    >
    >(remove nothere from the email address if mailing direct)
    >
    >> thanks, it worked, however, I do reqiure to save the acutal sheet the i'm
    >> viewing. In the example below i was in sheet3.

    >[quoted text clipped - 26 lines]
    >> >>
    >> >> brian


    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...l-new/200601/1

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1