+ Reply to Thread
Results 1 to 11 of 11

help on code transfered file move to targeted folder vba

  1. #1
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    help on code transfered file move to targeted folder vba

    Dear experts

    I have set of function in userform through combobox selection values to be new workbook to current file path but i want move workbook to targeted folder.

    i create new workbook through 6combobox selected values and click command button to move data to tageted file but new workbook stored in current file path only it not move to target file path

    pls find the attachment you might be understand. clearly what am i looking for...?

    code is in sheet

    thanks
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-14-2010
    Location
    Macau
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: help on code transfered file move to targeted folder vba

    Hi Breadwinner,
    After I view your code, noted
    .SaveAs ThisWorkbook.Path & "\SLC" & Me.ComboBox4.Value & "_" & Me.ComboBox6.Value & ".xls"
    Thisworkbook.path is your macro file path.
    if you need to move target folder replace your target folder path instead of "Thisworkbook.path".
    Hope you solve this problem.
    good luck!

  3. #3
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: help on code transfered file move to targeted folder vba

    No I tried It already doesnt work Any idea with code?
    Last edited by breadwinner; 08-07-2013 at 07:09 AM. Reason: MIssing

  4. #4
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: help on code transfered file move to targeted folder vba

    any one help on this?

  5. #5
    Registered User
    Join Date
    11-14-2010
    Location
    Macau
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: help on code transfered file move to targeted folder vba

    Where is your target folder?
    I can't find in yours' code?

  6. #6
    Forum Contributor
    Join Date
    07-23-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    143

    Re: help on code transfered file move to targeted folder vba

    i hope this will work


    Sub pull data
    Dim FolderName As String, wbName As String, r As Long, cValue As Variant
    Dim wbList() As String, wbCount As Integer, i As Integer
    FolderName = "C:\Foldername" (here paste your link)
    ' create list of workbooks in foldername
    wbCount = 0
    wbName = Dir(FolderName & "\" & "*.xls")
    While wbName <> ""
    wbCount = wbCount + 1
    ReDim Preserve wbList(1 To wbCount)
    wbList(wbCount) = wbName
    wbName = Dir
    Wend
    If wbCount = 0 Then Exit Sub
    ' get values from each workbook
    r = 0
    Workbooks.Add
    For i = 1 To wbCount
    r = r + 1
    cValue = GetInfoFromClosedFile(FolderName, wbList(i), "Sheet1", "A1")
    Cells(r, 1).Formula = wbList(i)
    Cells(r, 2).Formula = cValue
    Next i
    End Sub

    Private Function GetInfoFromClosedFile(ByVal wbPath As String, _
    wbName As String, wsName As String, cellRef As String) As Variant
    Dim arg As String
    GetInfoFromClosedFile = ""
    If Right(wbPath, 1) <> "\" Then wbPath = wbPath & "\"
    If Dir(wbPath & "\" & wbName) = "" Then Exit Function
    arg = "'" & wbPath & "[" & wbName & "]" & _
    wsName & "'!" & Range(cellRef).Address(True, True, xlR1C1)
    On Error Resume Next
    GetInfoFromClosedFile = ExecuteExcel4Macro(arg)
    End Function
    Last edited by johnodys; 08-09-2013 at 05:09 AM. Reason: vba code

  7. #7
    Forum Contributor
    Join Date
    07-23-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    143

    Re: help on code transfered file move to targeted folder vba

    try this code
    Last edited by johnodys; 08-09-2013 at 01:29 AM.

  8. #8
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: help on code transfered file move to targeted folder vba

    Here this is my code

    Please Login or Register  to view this content.
    i want assig my new workbook will save in particular folder..
    this my path(D:\Documents and Settings\Administrator\Desktop\FORUMINPUT\REBV\FOLDER) where i want save my new workbook.

  9. #9
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: help on code transfered file move to targeted folder vba

    any one help on this??????

  10. #10
    Registered User
    Join Date
    11-14-2010
    Location
    Macau
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: help on code transfered file move to targeted folder vba

    Please try this, changed alittle
    Please Login or Register  to view this content.
    Last edited by lotuxel; 08-09-2013 at 05:32 AM. Reason: Wrong string

  11. #11
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: help on code transfered file move to targeted folder vba

    Mr lotusexl............Thanks Dude Its works perfectly with your timely code of help!!!!!!!Keep your help for me?? needed
    Last edited by breadwinner; 08-09-2013 at 06:42 AM. Reason: help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA Split Data and Move to targeted named file from master file
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-19-2013, 01:06 PM
  2. Replies: 0
    Last Post: 01-02-2013, 07:01 PM
  3. search part of file name and move file to folder
    By James580 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-15-2008, 01:56 PM
  4. [SOLVED] Need code to save file to new folder, erase from old folder
    By Ron M. in forum Excel General
    Replies: 1
    Last Post: 02-24-2006, 02:10 PM
  5. macro to move from file to file, folder to folder
    By davegb in forum Excel General
    Replies: 0
    Last Post: 01-21-2005, 04:06 PM

Tags for this Thread

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