+ Reply to Thread
Results 1 to 5 of 5

does code for this exist? help please

  1. #1
    Registered User
    Join Date
    03-27-2005
    Posts
    59

    does code for this exist? help please

    basically based upon a condition i want to select a specific workbook for a specfic file (which i already have the code for) and paste it into another file for archived data
    is there a code from within a worksheet that will select a workbook cut it and paste it into another file? or is it not possible to select a workbook cut it and paste it, the only options available seem to be activate or open the workbook but not cut and paste

    many thanks

  2. #2
    Tom Ogilvy
    Guest

    Re: does code for this exist? help please

    Workbooks are files - therefore, you would work with files. Cutting and
    pasteing really are not concepts associated with workbooks.

    However, you could be using faulty terminology. For instance "a specific
    workbook for a specific file" seems ill constructed.

    --
    Regards,
    Tom Ogilvy

    "short_n_curly" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > basically based upon a condition i want to select a specific workbook
    > for a specfic file (which i already have the code for) and paste it
    > into another file for archived data
    > is there a code from within a worksheet that will select a workbook cut
    > it and paste it into another file? or is it not possible to select a
    > workbook cut it and paste it, the only options available seem to be
    > activate or open the workbook but not cut and paste
    >
    > many thanks
    >
    >
    > --
    > short_n_curly
    > ------------------------------------------------------------------------
    > short_n_curly's Profile:

    http://www.excelforum.com/member.php...o&userid=21576
    > View this thread: http://www.excelforum.com/showthread...hreadid=384157
    >




  3. #3
    Bob Phillips
    Guest

    Re: does code for this exist? help please

    You could be meaning to copy a worksheet from one workbook to another
    perhaps?

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "short_n_curly" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > basically based upon a condition i want to select a specific workbook
    > for a specfic file (which i already have the code for) and paste it
    > into another file for archived data
    > is there a code from within a worksheet that will select a workbook cut
    > it and paste it into another file? or is it not possible to select a
    > workbook cut it and paste it, the only options available seem to be
    > activate or open the workbook but not cut and paste
    >
    > many thanks
    >
    >
    > --
    > short_n_curly
    > ------------------------------------------------------------------------
    > short_n_curly's Profile:

    http://www.excelforum.com/member.php...o&userid=21576
    > View this thread: http://www.excelforum.com/showthread...hreadid=384157
    >




  4. #4
    Registered User
    Join Date
    03-27-2005
    Posts
    59
    it woks like this if cell c3 = "Archived" then workbooks(range(d3)).value is cut from file
    ChDir "C:\Documents and Settings\Carl\Desktop\Personal Training Clients"
    and is pasted into file
    ChDir "C:\Documents and Settings\Carl\Desktop\Archived Files"

    can i cut the workbook (i.e this workbook is not open) this code comes from a seperate workbook, what i am asking is that i have the code to rename files based upon cell contents and even code to open workbooks in the same way but there seem to be no option to cut the workbook and paste it into the desination folder, can this be done

    hope this breakdown helps thanks for the replies so far keep them coming please

  5. #5
    Tony Zappal
    Guest

    Re: does code for this exist? help please

    We use this basic one for file moves. Cant find the better coded macro, but
    this will get you by:
    --------------------------
    Dim fso2
    Dim DestPath, SourcePath, CurrentFileName As String

    Set fso2 = CreateObject("Scripting.FileSystemObject")
    DestPath = Range("$C$2").Value 'Destination File Path
    SourcePath = Range("$C$4").Value 'Source File Path
    Range("$K$3").Activate 'This would be your C3 cell.
    Do 'U may not need this loop as you may only be copying one file
    CurrentFileName = ActiveCell.Value
    fso2.CopyFile SourcePath & CurrentFileName & ".xls", DestPath
    ActiveCell.Offset(1, 0).Activate
    If ActiveCell.Value = Empty Then Exit Do
    Loop
    ------------------------------------------------


    "short_n_curly" wrote:

    >
    > it woks like this if cell c3 = "Archived" then
    > workbooks(range(d3)).value is cut from file
    > ChDir "C:\Documents and Settings\Carl\Desktop\Personal Training
    > Clients"
    > and is pasted into file
    > ChDir "C:\Documents and Settings\Carl\Desktop\Archived Files"
    >
    > can i cut the workbook (i.e this workbook is not open) this code comes
    > from a seperate workbook, what i am asking is that i have the code to
    > rename files based upon cell contents and even code to open workbooks
    > in the same way but there seem to be no option to cut the workbook and
    > paste it into the desination folder, can this be done
    >
    > hope this breakdown helps thanks for the replies so far keep them
    > coming please
    >
    >
    > --
    > short_n_curly
    > ------------------------------------------------------------------------
    > short_n_curly's Profile: http://www.excelforum.com/member.php...o&userid=21576
    > View this thread: http://www.excelforum.com/showthread...hreadid=384157
    >
    >


+ 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