+ Reply to Thread
Results 1 to 18 of 18

Need help with macro to get all corresponding row data when matches to adjacent cell value

  1. #1
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Need help with macro to get all corresponding row data when matches to adjacent cell value

    Dear Pros

    I have edited one macro to get my work around to get all the data from a column E make sheets by the values and copy the corresponding data to sheets.

    But i can not copy the data, sheets have been created. can any body look into the matter and help

    Further to add there might b 10 sheets with different ranges and 9 departments for which sheets would be made.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    Try like this

    Please Login or Register  to view this content.
    Kind regards
    Leo

  3. #3
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    Thanks Leo but it is not getting all the data, have you checked it. I want it to run and get all corresponding data of values present in column and make sheet of that column value. is there any thing like wks = Activesheet to wks = allsheets ? i need a work around for this

    Will be obliged for the help

  4. #4
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    I need macro to get data from all sheets, not just from active sheet ?? is it possible please help
    Last edited by toofani; 03-17-2016 at 12:49 PM.

  5. #5
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    Maybe like this, IF columns have the same kind of data in each sheet

    Please Login or Register  to view this content.
    Kind regards
    Leo

  6. #6
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    Untitled.png

    when i click debug this line is highligted rng.AutoFilter field:=5, Criteria1:=arr(i) can anybody help

  7. #7
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    it is working in this file


    Kind regards
    Leo
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    but when i use it with bigger data file, it gives this error .. which i showed you.. the data which is provided is a dummy data, there are nine departments for which sheets would be created and there are 10 different sheets from which macro will pull out the data..

  9. #9
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    without the file i have no idee


    Kind regards
    Leo

  10. #10
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    file is attached
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    One of the sheets has the autofilter in column E, thats wy

    so this take care of it

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    thank you very much

  13. #13
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    Dear Leo

    One last time i would like to request you to look at this file, when i run the file two names are repeating in each sheet one is from Sindh Urban Last name and one is from nominee first one

    Please help to find me the error so i can correct it for further use, rest its working perfectly

    I have highlighted the names in each sheet created.

    And one addition can i add another empty column on right side and borders to all the column with the code


    Appreciated your help alot, last one is requested
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    2 modifications, marked in red for the wrong names in sheets
    extra part for the borders.

    Please Login or Register  to view this content.
    Kind regards
    Leo

  15. #15
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    wow thanks alotttttt really helpful and will help me in future use

  16. #16
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    Dear LEO

    Again bothering you! but still one name appears in all sheets Yousuf Abdi when we run the macro. it belongs from PG and appearing in all sheets. its present in Nomination sheet

  17. #17
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    Hi Toofani,

    i dont wy but i had the same until i changed (increase) the row hight from sheets nomination row 1
    so try this first.

    Kind regards
    Leo

  18. #18
    Registered User
    Join Date
    10-15-2014
    Location
    Pakistan
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Need help with macro to get all corresponding row data when matches to adjacent cell v

    yup did the job

+ 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] Macro to copy data from one cell to another if adjacent cell meets certain requirements?
    By rrokicki in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-08-2016, 07:41 AM
  2. Replies: 1
    Last Post: 07-20-2015, 10:58 AM
  3. Replies: 3
    Last Post: 06-29-2015, 03:03 PM
  4. VBA Macro to autofill data in column based on value on adjacent cell
    By cazantheman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2013, 02:04 PM
  5. Replies: 6
    Last Post: 04-12-2013, 05:50 AM
  6. If one cell matches another display a value in adjacent cell
    By Garfield779 in forum Excel General
    Replies: 1
    Last Post: 07-07-2011, 11:49 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