+ Reply to Thread
Results 1 to 17 of 17

sync data between two tabs in same workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    sync data between two tabs in same workbook

    I have an excel file that has 2 tabs. The first tab is labeled DATA and has 18,000 lines. The second tab is labeled Requests. I have a task of receiving a request for date change for a particulate part number at a particular location. I add that request to the request tab and then investigate if that date change can happen. If it can happen then I update the request tab with the new date for the part number and location. The pain is trying to find the part number and location in the massive amount of data in the DATA tab. Part numbers can be repeated for different locations. For instance in the attached excel file. Line 2 of the reqest is cookies (C2) to be baked at a bakery (E2) until 3/31/2028 (D2). The reply from the bakery is they can agree to a date that is placed in (F2). Sync: If request tab C2 = data tab B2 and reqeust tab E2=data tab J2 then request tab K2= data tab A2 and reqeust tab F2=data tab K2. Any help is greatly apreicated

    sync.xlsx

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: sync data between two tabs in same workbook

    See if this is what you're looking for.

    You're not exactly clear about 'what to do' when you find a match.

    Alt F8 and RunRequests

    Double click the entry to see result, if there are any.
    Attached Files Attached Files
    Last edited by Tinbendr; 02-12-2025 at 12:25 PM.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: sync data between two tabs in same workbook

    Thank you Tinbendr.

    Your form has captured the Requests tab fine. What I would now like it to do is do something like a vlookup with the DATA tab.
    Using the Request tab, look at line 1 and grab the contents of cells C and E. Then look at the the Data tab and match the line that has the same item and location as the reqeust tab.
    Once you have the correct line identified in the DATA tab, I need to modify that line with the new date received.

    Nick

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: sync data between two tabs in same workbook

    And do you want to be taken to 'that' line in Data tab and close the userform?
    Do you want to have a date picker pop up and select a date?
    Do you want to manually enter the new date?

  5. #5
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: sync data between two tabs in same workbook

    It may be beneficial to be taken to that line and then I can confirm the correct line was selected. Accept the line and have the data auto populate from the request tab?

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: sync data between two tabs in same workbook

    How about this? I created a seconded window to bring up the entry with an update button.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: sync data between two tabs in same workbook

    Ok I like that when I click on the first line it provides in the second box the line number it matched. I don't think the update is working however. When I click on the update I should see the value in Column F of the reqeust tab, update column K of the matching line for the DATA tab.

  8. #8
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: sync data between two tabs in same workbook

    Yep, I was a column off on the date.

    See if this works.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: sync data between two tabs in same workbook

    Ok I think I saw something happen but I don't think its the correct value yet. I should see cell K2 of the DATA tab change to 3/31/2028 or cell F2 of the Requests tab.

  10. #10
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: sync data between two tabs in same workbook

    Change the 10 to 3 (or 5) Is Requests Column D and F always the same?

    Private Sub cmdUpdate_Click()
    
    With Worksheets("Data")
        .Activate
        .Range("K" & UserForm1.ListBox2.List(UserForm1.ListBox2.ListIndex, 4)) = _
            UserForm1.ListBox1.List(UserForm1.ListBox1.ListIndex, 3)
        .Range("K" & UserForm1.ListBox2.List(UserForm1.ListBox2.ListIndex, 4)).Select
    End With
    
    Unload UserForm2
    End Sub

  11. #11
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: sync data between two tabs in same workbook

    I'm not sure if I understand. I've never used UserForm or ListBox before. My VBA is very limited so I'm a little lost. That being said, Im not sure what 10 to 3 (or 5) refers to. Reqeusts Column D and F are typically the same. It is possible that they may differ but I have yet to run into that situation.

  12. #12
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: sync data between two tabs in same workbook

    Alt-F11, double click userform2, F7, locate the 10 (line 3) in the cmdUpdate_Click() subroutine and change to 3.
    Save Workbook.

  13. #13
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: sync data between two tabs in same workbook

    Ok, let me review and try and work this out.

  14. #14
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: sync data between two tabs in same workbook

    Thank you very much, I think that worked out. Let me play with this and the actual files to see If I get the same results. Thank you Nick

  15. #15
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: sync data between two tabs in same workbook

    Hi Tinbendr, Sorry for the long wait. I had to do some clean up on my actual file. I somehow forgot the A column when creating the file for this site.
    I was able to figure out where to make the change in your code so its good now.
    I also had a lot of locations that were spelled differently then what the DATA sheet had. It caused a lot of mis matching.
    The "bake date received" is getting correctly pouplated, with the data from the request tab of "bake date received".
    However, the effective date on the DATA sheet isn't getting poplulated by the "date response was received" in column K of the reqeust tab.

    sync ver3.xlsm

  16. #16
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: sync data between two tabs in same workbook

    Totally forgot about the second date.

    Should be fixed now.

    I added a view button to call the userform2 along with the double click. (Just makes things consistent and helps sooth my OCD.


    It will be greyed out until you select a line in userform1.listbox2.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    06-07-2012
    Location
    US
    MS-Off Ver
    Excel Office 365
    Posts
    66

    Re: sync data between two tabs in same workbook

    Tinbendr,

    Yes, that did it. Thank you very much. This has always been a PITA for me especially when you leave it for a while and need to do a catch up.
    The approach by showing the matched line before the change is perfect. And yes, your additional view button to call back user form 2 is a good addition. I'm going to mark this as solved.

    Thanks
    Nick

+ 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. Replies: 1
    Last Post: 10-29-2022, 05:42 PM
  2. is it possible to Sync 2 Workbook using Data Query ?
    By jasond1992 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2021, 10:49 AM
  3. [SOLVED] Copying tabs (which mach the name of tabs in cuurent workbook) from another workbook
    By stevoDE in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2017, 11:45 AM
  4. [SOLVED] Main Workbook Sync
    By LewisJ in forum Excel General
    Replies: 2
    Last Post: 03-27-2017, 09:55 AM
  5. Sync two cells in the same workbook - but in different worksheets
    By jmcwho01 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2015, 05:18 PM
  6. Pulling data from one workbook with multiple tabs to another workbook.
    By manzier in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2014, 03:41 PM
  7. [SOLVED] Extract data from a workbook with multiple tabs, into a workbook with corresponding tabs
    By krackaberr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 11:54 AM

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