+ Reply to Thread
Results 1 to 3 of 3

Textbox input as file location for data merge

Hybrid View

  1. #1
    Registered User
    Join Date
    01-02-2010
    Location
    Washington
    MS-Off Ver
    Excel 2007
    Posts
    4

    Textbox input as file location for data merge

    Sub MergeHorizontally() --Courtesy of Ron de Bruin
        Dim MyPath As String, FilesInPath As String
        Dim MyFiles() As String
        Dim SourceCcount As Long, FNum As Long
        Dim mybook As Workbook, BaseWks As Worksheet
        Dim sourceRange As Range, destrange As Range
        Dim Cnum As Long, CalcMode As Long
    
        ' Change this to the path\folder location of the files.
        MyPath = " File Location" 
        ' I would like for this location to be the path entered in a textbox on   Sheet1
    Any ideas on how I can make this work? Thanks!
    Last edited by excelman45; 01-03-2010 at 05:37 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Textbox input as file location for data merge

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-02-2010
    Location
    Washington
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Textbox input as file location for data merge

    I was not able to figure out how to make this work with a textbox; however, I was able to set the path equal to the value of a cell (B3) and that worked just fine. It doesn't look as good, but it gets the job done.

    ' Change this to the path\folder location of the files.
        MyPath = Range("B3")

+ 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