Closed Thread
Results 1 to 9 of 9

Data transfer between two sheets based on condition

Hybrid View

  1. #1
    Registered User
    Join Date
    11-25-2008
    Location
    London
    Posts
    5

    Data transfer between two sheets based on condition

    Hi,

    I work for a sales team and we have a bit of a problem automating a process for copying data from one sheet to another based on phone numbers.As of now this process is manual and my team spend hours doing this manually.

    We have weekly reports coming to us as shown in 'Week 34.xls' (copy of the sheets attached)spreadsheet,and we manually transfer data from Coloumn E and Coloumn AC into the sheet 'DM Tracker.xls',based on matching Telephone numbers in coloumn B of 'Week 34.xls' spreadsheet and coloumn B of 'DM Tracker'.

    I was wondering if there is a way to automate this process? This will definitely save us hours of work,especially on those 'Dreadful Mondays'!

    Any help on this will be very much appreciated..

    Thanks,
    Andy
    Attached Files Attached Files
    Last edited by agasi999; 11-26-2008 at 06:35 AM. Reason: Title modified

  2. #2
    Registered User
    Join Date
    11-25-2008
    Location
    London
    Posts
    5

    Hi Macro help

    Sorry ..here are the attachments...thanks
    Last edited by arthurbr; 11-25-2008 at 10:14 AM.

  3. #3
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    macro

    Hi
    keep both files open. Run the macro from sheet2 of dm tracker. it fills col C & D based on phone nos.
    Ravi
    Last edited by arthurbr; 11-25-2008 at 10:14 AM.

  4. #4
    Registered User
    Join Date
    11-25-2008
    Location
    London
    Posts
    5
    Thanks Ravi! I tried running your code,but I got a 'Run time error 9 - subscript out of range error' at line 4 'y = Workbooks(..)'

    Thanks,
    Matt

    Sub pulldata()
    x = Workbooks("DM Tracker.xls").Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
    y = Workbooks("Week 34.xls").Worksheets("Overall").Cells(Rows.Count, 1).End(xlUp).Row
    For a = 3 To x
    Workbooks("DM Tracker.xls").Worksheets("sheet2").Cells(1, 26) = "=match(B" & a & "[Week 34.xls]overall!B2:B" & y & ",0)"
    b = Workbooks("DM Tracker.xls").Worksheets("sheet2").Cells(1, 26)
    Workbooks("DM Tracker.xls").Worksheets("sheet2").Cells(a, 3) = Workbooks("Week 34.xls").Worksheets("overall").Cells(b, 5)
    Workbooks("DM Tracker.xls").Worksheets("sheet2").Cells(a, 4) = Workbooks("Week 34.xls").Worksheets("overall").Cells(b, 29)
    Next a
    MsgBox "collecting data complete"
    End Sub

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Thread closed for ignoring forum rules.

    PM me after you read the forum rules below and agree to add the link to the other excel forum and start using code tags

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Welcome to the forum.

    Please read the Forum Rules about thread titles, and then edit yours to be descriptive of your problem.

    Thanks.

  7. #7
    Registered User
    Join Date
    11-25-2008
    Location
    London
    Posts
    5
    Hi Arthur,

    Ive changed the title to reflect the nature of the problem. Please can you remove the lock on the reply provided by ravishankar?

    Regards,
    Matt

  8. #8
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Hi Matt,
    undeleted as asked.
    Thx for your cooperation

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    agasi999,

    If you read the forum rules like you we're asked you would have seen cross posting without the link is not permitted.

    Please add the link to the other forum

    VBA Noob

Closed 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