+ Reply to Thread
Results 1 to 20 of 20

Exctract lines in sheet to another sheet based on text/names in cell

  1. #1
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Exctract lines in sheet to another sheet based on text/names in cell

    Hi!

    As my long title says I am trying to figure out how to extract rows in a "master sheet" automatically to another sheet based on names (initials) in a coloumn.

    The worksheet consists of multiple rows with multiple columns.
    One of the coloumns will contain names. Some one name, others several - divided by commas.

    If name X is present in row 6, coloumn D: is it possible to have Excel automatically transfer that row into a new sheet that is automatically named X?

    If name X and Y is present in row 7, coloumn D: is it possible to transfer/exctract that row into sheet X (which was made after row 6) and into a new sheet named Y?

    I hope that someone can help me out here!

  2. #2
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Please attach a sample file.
    Kamboj
    _________________________________________________________________________________
    Mark the thread as SOLVED if my answer satisfy you.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Assuming header in row1.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Thank you for your swift reply!
    I have attached a sample file.

    I have not tested the code you gave me yet - I was not allowed to run it on my mac for some reason !?
    Ideally i would like it to add a row to a designated sheet (by names given in the "Responsible" coloumn) as soon as a new row has been entered and a "Responsible" person is added.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Mac?

    Your profile says 2010....


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jindon; 01-07-2016 at 09:12 AM. Reason: One line added and file attached.

  6. #6
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Many Thanks!
    It works very well!

    I use a mac on work...

    Is there a way to have the macro "run" continuously, or do i have to execute the macro manually each time to have it add rows to new sheets?

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Not really sure what you are asking...
    Here's my guess.
    Function IsSheetExists must be remain intact.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Appreciate it!

    Now the lines are duplicated in the new sheets.

    Ill try to explain better:
    When I am working in the master sheet and fill in new names (Responsible) in new rows I would like it (the macro (?)) to copy that line into its respective sheets without running the macro manually after each line I enter.

    Maybe I have done something wrong, but i now have to link the macro to a button and run it for it to take effect.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Are you just adding and not deleting or clearing the data in master sheet?

  10. #10
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    No, I deleted everything except Function IsSheetExists...

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    You are misunderstanding my question...
    1) to a standard module
    Please Login or Register  to view this content.
    2) Master sheet code module
    Please Login or Register  to view this content.
    3) ThisWorkbook code module
    Please Login or Register  to view this content.
    This enables you to update each sheet whenever you open a workbook or select any sheet other than Master.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    I have made some changes to the sheet regarding to position of the different topics of cell. I tried to change the code accordingly, but I am afraid my skills are not that good.

    Header is now in Row 1,2 and 3 (wrapped).
    Name/responsible is starting on Row 4 and is placed in Column E.

    Could you please point me to where in the code I can change these values?
    I found out that I needed to change "For i = 2 To UBound(a, 1..:" to = 4

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    If your data layouts differs from what you have posted, no suggestion from me until I actually see the data layouts.

  14. #14
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Thank you again for the new code

    The Row is now transferred to new Sheet when I select and open a random sheet, but not when I start to write in a new Row.

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Quote Originally Posted by Generalist View Post
    Thank you again for the new code

    The Row is now transferred to new Sheet when I select and open a random sheet, but not when I start to write in a new Row.
    Why you want it so?
    If you update "Master" and select other sheet, it will update....
    To me, it is the same.

  16. #16
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    I agree, Jindon. It is a good solution!

    I have made some changes to the sheet, causing the code to not doing what I need (see attached file).

    Like I said in the previous post I am trying to change the correct lines in your code so it extract each row based on the name in coloumn D to a sheet with the same name as the name in D - Displaying the heading in row 1,2 and 3 as well.

    To further complicate it I would like to extract the "risk"-cell in each row to its own sheet, with the info in column A also showing in the same sheet.

    Any help is greatly appreciated.
    Attached Files Attached Files

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Why do you need to merge row1 & 2?
    If you want to manipulate the data, raw data range should not have merged cells.
    It only gives you a problem.

  18. #18
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Ok. The problem is that I am working in a already fixed template, so I have to adjust to it - not the other way around

  19. #19
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    ............................
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    10-21-2015
    Location
    EUR
    MS-Off Ver
    Professional Plus 2010
    Posts
    41

    Re: Exctract lines in sheet to another sheet based on text/names in cell

    Thank you very much, Jindon!

    One thing I cant figure out is why it doesnt exctract a name/line if I jump down to a random row.
    Say that I start on row 4 and fill out to row 6, and then I jump to row 13 and start to fill in data. Then the row is not transferred to a new/its own sheet.
    Any inputs?

    once again, Thank you very much for your help.

+ 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: 3
    Last Post: 10-01-2014, 01:49 PM
  2. Automatically Change Sheet Names Based On Cell Values - merged cells
    By Elizabethz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-24-2014, 11:35 AM
  3. Replies: 5
    Last Post: 05-29-2014, 05:09 PM
  4. [SOLVED] automatic replace sheet names based on new cell text (within defined range)
    By Robert1311 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-08-2014, 05:37 AM
  5. change cell names based on new sheet name
    By tdebb8594 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2014, 02:25 PM
  6. Changing Sheet Names based on a Cell Reference
    By tjloggia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-04-2012, 04:35 PM
  7. Function to name sheet based on on sheet names.
    By c991257 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2007, 10:46 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