+ Reply to Thread
Results 1 to 6 of 6

how do i automaticly "save as" using a cell's content as file nam

  1. #1
    cxlough41
    Guest

    how do i automaticly "save as" using a cell's content as file nam



  2. #2
    PCLIVE
    Guest

    Re: how do i automaticly "save as" using a cell's content as file nam

    I'm sure you'll need to use VBA for this. This will save the file with the
    name based on the contents of A1.

    Sub AutoSaveName()
    ActiveWorkbook.SaveAs Range("A1").Value
    End Sub


    If you want to specify a save location:

    Sub AutoSaveName()
    ActiveWorkbook.SaveAs Filename:="C:\Temp\" & Range("A1").Value & ".xls",
    FileFormat:=xlNormal, _
    Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
    CreateBackup:=False
    End Sub

    HTH,
    Paul

    "cxlough41" <cxlough41@discussions.microsoft.com> wrote in message
    news:5F8FE61E-6173-4936-8828-D0AC1A80203D@microsoft.com...
    >




  3. #3
    cxlough41
    Guest

    Re: how do i automaticly "save as" using a cell's content as file

    PC,

    thanks.... but.... this does not seem to work am i supposed to do something
    first to make these codes work... i have tried a number of them and none seem
    to work.

    i am running xp with office pro 2003, i have never had a successfull outcome
    using vba/vbe. i think i must be doin some thing wrong or i am not set up to
    run these codes.

    HELP!...lol


    "PCLIVE" wrote:

    > I'm sure you'll need to use VBA for this. This will save the file with the
    > name based on the contents of A1.
    >
    > Sub AutoSaveName()
    > ActiveWorkbook.SaveAs Range("A1").Value
    > End Sub
    >
    >
    > If you want to specify a save location:
    >
    > Sub AutoSaveName()
    > ActiveWorkbook.SaveAs Filename:="C:\Temp\" & Range("A1").Value & ".xls",
    > FileFormat:=xlNormal, _
    > Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
    > CreateBackup:=False
    > End Sub
    >
    > HTH,
    > Paul
    >
    > "cxlough41" <cxlough41@discussions.microsoft.com> wrote in message
    > news:5F8FE61E-6173-4936-8828-D0AC1A80203D@microsoft.com...
    > >

    >
    >
    >


  4. #4
    PCLIVE
    Guest

    Re: how do i automaticly "save as" using a cell's content as file

    To open the VB Editor, press Alt and F11.

    On the left side, right-click on 'Modules', select 'Insert', and click
    'Module'.
    Paste the following code under Sub Macro1().

    ActiveWorkbook.SaveAs Filename:="C:\Temp\" & Range("A1").Value & ".xls", _
    FileFormat:=xlNormal, _
    Password:="", _
    WriteResPassword:="", _
    ReadOnlyRecommended:=False, _
    CreateBackup:=False


    Once this is done, close the MS Visual Basic Window.
    Then click Tools->Macro->Macros.
    Highlight 'Macro1" and then click 'Options...".
    Select a Shortcut key. This is the key press you will use to run the macro.
    Example. Ctrl+Y
    Once a shortcut key has been selected, click OK, then Cancel. Use your
    selected shortcut to activate the macro whenever needed.

    HTH,
    Paul



    "cxlough41" <cxlough41@discussions.microsoft.com> wrote in message
    news:3FB46B59-1F4B-47C0-B024-2470894D42F6@microsoft.com...
    > PC,
    >
    > thanks.... but.... this does not seem to work am i supposed to do
    > something
    > first to make these codes work... i have tried a number of them and none
    > seem
    > to work.
    >
    > i am running xp with office pro 2003, i have never had a successfull
    > outcome
    > using vba/vbe. i think i must be doin some thing wrong or i am not set up
    > to
    > run these codes.
    >
    > HELP!...lol
    >
    >
    > "PCLIVE" wrote:
    >
    >> I'm sure you'll need to use VBA for this. This will save the file with
    >> the
    >> name based on the contents of A1.
    >>
    >> Sub AutoSaveName()
    >> ActiveWorkbook.SaveAs Range("A1").Value
    >> End Sub
    >>
    >>
    >> If you want to specify a save location:
    >>
    >> Sub AutoSaveName()
    >> ActiveWorkbook.SaveAs Filename:="C:\Temp\" & Range("A1").Value & ".xls",
    >> FileFormat:=xlNormal, _
    >> Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
    >> CreateBackup:=False
    >> End Sub
    >>
    >> HTH,
    >> Paul
    >>
    >> "cxlough41" <cxlough41@discussions.microsoft.com> wrote in message
    >> news:5F8FE61E-6173-4936-8828-D0AC1A80203D@microsoft.com...
    >> >

    >>
    >>
    >>




  5. #5
    cxlough41
    Guest

    Re: how do i automaticly "save as" using a cell's content as file

    this is crazy... ok this is what i get...
    first... alt+F11 brings up a chart worksheet which can't be right....i
    think... so what i did was right clicked on the excel icon to the left of the
    file button... click "view code" and VBA editor opens... then on the left
    side, right-click on 'Modules', select 'Insert', and click 'Module' (there is
    a list of all worksheets in the workbook under "microsoft excel objects"
    folder... and there is an icon for the "workbook module" at the bottom). it
    seems each sheet has a module. when i created the new as instructed it is
    named "Module1" under the modules folder.

    i assume that this "Modules" folder and the smaller window named "module 1
    (code)" is where the code you gave me goes.

    i pasted the code here and followed the rest of your instruction.

    when i get to the "Tools \ Macro \ Macros \ the macros window is completely
    empty and i can not chose options as it is geyed out as an available click.
    therefore i can not go any further.

    do i need to set up macros first or should everything up to now make it work?

    i am so lost... thanks for your help.

    the following is not there.
    *Paste the following code under Sub Macro1().*
    what i get is
    *
    "PCLIVE" wrote:

    > To open the VB Editor, press Alt and F11.
    >
    > On the left side, right-click on 'Modules', select 'Insert', and click
    > 'Module'.
    > Paste the following code under Sub Macro1().
    >
    > ActiveWorkbook.SaveAs Filename:="C:\Temp\" & Range("A1").Value & ".xls", _
    > FileFormat:=xlNormal, _
    > Password:="", _
    > WriteResPassword:="", _
    > ReadOnlyRecommended:=False, _
    > CreateBackup:=False
    >
    >
    > Once this is done, close the MS Visual Basic Window.
    > Then click Tools->Macro->Macros.
    > Highlight 'Macro1" and then click 'Options...".
    > Select a Shortcut key. This is the key press you will use to run the macro.
    > Example. Ctrl+Y
    > Once a shortcut key has been selected, click OK, then Cancel. Use your
    > selected shortcut to activate the macro whenever needed.
    >
    > HTH,
    > Paul
    >
    >
    >
    > "cxlough41" <cxlough41@discussions.microsoft.com> wrote in message
    > news:3FB46B59-1F4B-47C0-B024-2470894D42F6@microsoft.com...
    > > PC,
    > >
    > > thanks.... but.... this does not seem to work am i supposed to do
    > > something
    > > first to make these codes work... i have tried a number of them and none
    > > seem
    > > to work.
    > >
    > > i am running xp with office pro 2003, i have never had a successfull
    > > outcome
    > > using vba/vbe. i think i must be doin some thing wrong or i am not set up
    > > to
    > > run these codes.
    > >
    > > HELP!...lol
    > >
    > >
    > > "PCLIVE" wrote:
    > >
    > >> I'm sure you'll need to use VBA for this. This will save the file with
    > >> the
    > >> name based on the contents of A1.
    > >>
    > >> Sub AutoSaveName()
    > >> ActiveWorkbook.SaveAs Range("A1").Value
    > >> End Sub
    > >>
    > >>
    > >> If you want to specify a save location:
    > >>
    > >> Sub AutoSaveName()
    > >> ActiveWorkbook.SaveAs Filename:="C:\Temp\" & Range("A1").Value & ".xls",
    > >> FileFormat:=xlNormal, _
    > >> Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
    > >> CreateBackup:=False
    > >> End Sub
    > >>
    > >> HTH,
    > >> Paul
    > >>
    > >> "cxlough41" <cxlough41@discussions.microsoft.com> wrote in message
    > >> news:5F8FE61E-6173-4936-8828-D0AC1A80203D@microsoft.com...
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >


  6. #6
    cxlough41
    Guest

    Re: how do i automaticly "save as" using a cell's content as file

    PC,

    i got it!
    just one more question though... what is the difference between the two
    codes you gave me. it looks like one is for a manual and the other is for
    the auto. I got the manual to work but i did not get the auto to work. i
    guess i can play with it while the manual will do for now.

    please let me know if you think of anything that might help me get the auto
    to run by its self.

    thank you for your kind help.

    "PCLIVE" wrote:

    > To open the VB Editor, press Alt and F11.
    >
    > On the left side, right-click on 'Modules', select 'Insert', and click
    > 'Module'.
    > Paste the following code under Sub Macro1().
    >
    > ActiveWorkbook.SaveAs Filename:="C:\Temp\" & Range("A1").Value & ".xls", _
    > FileFormat:=xlNormal, _
    > Password:="", _
    > WriteResPassword:="", _
    > ReadOnlyRecommended:=False, _
    > CreateBackup:=False
    >
    >
    > Once this is done, close the MS Visual Basic Window.
    > Then click Tools->Macro->Macros.
    > Highlight 'Macro1" and then click 'Options...".
    > Select a Shortcut key. This is the key press you will use to run the macro.
    > Example. Ctrl+Y
    > Once a shortcut key has been selected, click OK, then Cancel. Use your
    > selected shortcut to activate the macro whenever needed.
    >
    > HTH,
    > Paul
    >
    >
    >
    > "cxlough41" <cxlough41@discussions.microsoft.com> wrote in message
    > news:3FB46B59-1F4B-47C0-B024-2470894D42F6@microsoft.com...
    > > PC,
    > >
    > > thanks.... but.... this does not seem to work am i supposed to do
    > > something
    > > first to make these codes work... i have tried a number of them and none
    > > seem
    > > to work.
    > >
    > > i am running xp with office pro 2003, i have never had a successfull
    > > outcome
    > > using vba/vbe. i think i must be doin some thing wrong or i am not set up
    > > to
    > > run these codes.
    > >
    > > HELP!...lol
    > >
    > >
    > > "PCLIVE" wrote:
    > >
    > >> I'm sure you'll need to use VBA for this. This will save the file with
    > >> the
    > >> name based on the contents of A1.
    > >>
    > >> Sub AutoSaveName()
    > >> ActiveWorkbook.SaveAs Range("A1").Value
    > >> End Sub
    > >>
    > >>
    > >> If you want to specify a save location:
    > >>
    > >> Sub AutoSaveName()
    > >> ActiveWorkbook.SaveAs Filename:="C:\Temp\" & Range("A1").Value & ".xls",
    > >> FileFormat:=xlNormal, _
    > >> Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
    > >> CreateBackup:=False
    > >> End Sub
    > >>
    > >> HTH,
    > >> Paul
    > >>
    > >> "cxlough41" <cxlough41@discussions.microsoft.com> wrote in message
    > >> news:5F8FE61E-6173-4936-8828-D0AC1A80203D@microsoft.com...
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >


+ 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