+ Reply to Thread
Results 1 to 28 of 28

VBA code to import pick'em picks into master sheet

Hybrid View

chadwick140 VBA code to import pick'em... 08-23-2013, 10:59 PM
jaslake Re: VBA code to import... 08-24-2013, 01:41 PM
chadwick140 Re: VBA code to import... 08-24-2013, 05:10 PM
jaslake Re: VBA code to import... 08-24-2013, 05:14 PM
chadwick140 Re: VBA code to import... 08-24-2013, 05:29 PM
jaslake Re: VBA code to import... 08-24-2013, 07:29 PM
chadwick140 Re: VBA code to import... 08-24-2013, 08:21 PM
jaslake Re: VBA code to import... 08-25-2013, 12:26 PM
chadwick140 Re: VBA code to import... 08-25-2013, 12:34 PM
jaslake Re: VBA code to import... 08-25-2013, 03:32 PM
chadwick140 Re: VBA code to import... 08-25-2013, 05:50 PM
jaslake Re: VBA code to import... 08-25-2013, 06:24 PM
chadwick140 Re: VBA code to import... 08-25-2013, 08:13 PM
chadwick140 Re: VBA code to import... 08-26-2013, 02:02 AM
jaslake Re: VBA code to import... 08-26-2013, 09:55 AM
chadwick140 Re: VBA code to import... 08-26-2013, 05:28 PM
jaslake Re: VBA code to import... 08-26-2013, 08:17 PM
chadwick140 Re: VBA code to import... 08-26-2013, 08:49 PM
jaslake Re: VBA code to import... 08-26-2013, 09:36 PM
chadwick140 Re: VBA code to import... 08-26-2013, 09:43 PM
jaslake Re: VBA code to import... 08-27-2013, 11:04 AM
  1. #1
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA code to import pick'em picks into master sheet

    Hi Chad

    I have the Code written to update Master from Weekly Picks. What I still need from you is to explain how each individual's Weekly Picks get inputed into the Weekly Picks Workbook...what's the Source of that information?

    Here's the Code as it currently stands.
    Public sWB As Workbook
    Public sWS As Worksheet
    Public tWB As Workbook
    Public tWS As Worksheet
    Public fname As String
    Public fname1 As String
    Public LR As Long
    Public Rng As Range
    Public cel As Range
    
    Option Explicit
    
    Sub Open_Master_File()
    
        With Application.FileDialog(msoFileDialogOpen)
            .InitialFileName = "C:\Documents and Settings\Administrator\Desktop\chadwick140\New Stuff\Target Files"   'this is the default folder shown
            .AllowMultiSelect = False
            .Filters.Add "All Files", "*.*"        'everything
            .Filters.Add "Excel Files", "*.xl*", 1  'default
            .Show
            If .SelectedItems.Count > 0 Then
                fname = .SelectedItems(1)
            Else
                Exit Sub
            End If
        End With
        Set tWB = Workbooks.Open(fname)
        Set tWS = tWB.Sheets(1)
        Call Open_Weekly_File
    End Sub
    
    
    Sub Open_Weekly_File()
    
        With Application.FileDialog(msoFileDialogOpen)
            .InitialFileName = "C:\Documents and Settings\Administrator\Desktop\chadwick140\New Stuff\Source Files"   'this is the default folder shown
            .AllowMultiSelect = False
            .Filters.Add "All Files", "*.*"        'everything
            .Filters.Add "Excel Files", "*.xl*", 1  'default
            .Show
            If .SelectedItems.Count > 0 Then
                fname1 = .SelectedItems(1)
            Else
                Exit Sub
            End If
        End With
        Set sWB = Workbooks.Open(fname1)
        Set sWS = sWB.Sheets(1)
        Call Fill_Master
    End Sub
    
    
    Sub Fill_Master()
        Dim myName As Range
        sWB.Names.Add Name:="Names", RefersTo:= _
                "=OFFSET('" & sWS.Name & "'!$L$6,0,0,(COUNTA('" & sWS.Name & "'!$L:$L)-1),1)"
    
        With tWS
            LR = .Cells(3, 1).End(xlDown).Offset(0, 0).Row
            Set Rng = .Range("A3:A" & LR)
            For Each cel In Range("Names")
                Set myName = Rng.Find(cel, , xlValues, xlWhole, xlByRows, xlNext, False)
                If Not myName Is Nothing Then
                    sWS.Range("C5").Value = cel
                    myName.Offset(0, 1).Resize(1, 14).Value = sWS.Range("AA2:AN2").Value
                    myName.Offset(0, 17).Value = sWS.Range("AO2").Value
                    myName.Offset(0, 19).Value = sWS.Range("AP2").Value
                End If
            Next cel
        End With
        sWB.Close False
    End Sub
    These two lines of Code will need to be changed to suit your environment.
    .InitialFileName = "C:\Documents and Settings\Administrator\Desktop\chadwick140\New Stuff\Target Files"   'this is the default folder shown
    .InitialFileName = "C:\Documents and Settings\Administrator\Desktop\chadwick140\New Stuff\Source Files"   'this is the default folder shown
    Last edited by jaslake; 08-25-2013 at 03:35 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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] Formula in one cell that picks up another based on dates provided in the same sheet
    By s.tara91 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-16-2013, 12:58 AM
  2. vba code for master sheet
    By kandre in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-21-2013, 10:17 AM
  3. VBA Sheet array code not working with drop down lists in master sheet
    By chiplaidlaw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2012, 11:01 AM
  4. Replies: 2
    Last Post: 07-17-2008, 08:37 AM
  5. Validation Pick Lists: Picks containing spaces
    By ComcoDG in forum Excel General
    Replies: 11
    Last Post: 07-15-2008, 04:42 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