Results 1 to 3 of 3

Using pop-up box as starting point for rest of macro

Threaded View

  1. #1
    Registered User
    Join Date
    07-22-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Using pop-up box as starting point for rest of macro

    Hey everybody,

    I am new to VBA code and looking for some help on utilising user input from a pop-up box as the starting position for the rest of a macro.
    I have the found the below code elsewhere that will satisfy the requirments selecting the starting cell for the rest of the code, but am unsure how to pass this onto the next part of the code:

    Sub TestInputBox()
        Dim myRange As Range
     
        Set myRange = Application.InputBox(Prompt:= _
            "Please Select a Range", _
            Title:="InputBox Method", Type:=8)
     
        If myRange Is Nothing Then
            ' Range is blank
        Else
            myRange.Select
        End If
    
    End Sub

    Here's the problem in a nut shell:
    I have 4 or 5 files whose data I want to extract into a Master or Summary workbook. The data begins at the same cell location within these files but they are of varying lengths. So the problem is, I can key the starting point within that file, but not the end point and therefore cannot assume where the next files data should begin executing the various if-statements within the Master spreadsheet.
    So I would like the user to ideally specify the name and location of the first file and where the ensuing code should start running from within the Master sheet. Ans then repeat this process for all the data files.
    So ideally there would be a pop-up box that asks:
    How many files do you have?
    Where/What is the name of the first file?
    What cell should we start executing code in?
    Where is the seond file?
    What cell should we start executing code in?............and repeat for all files.

    I hope this is specific enough, let me know if you need more detail or clarification.

    Cheers,

    Kane
    Last edited by Cutter; 07-22-2012 at 08:52 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

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

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