+ Reply to Thread
Results 1 to 15 of 15

Define New Names for Specific Cells

  1. #1
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Define New Names for Specific Cells

    hi all

    i need your help please, check both attached files; before and after.

    i need to sort column A from A to Z

    then

    define new names, if same value in column A, then referes the name to all cells contains same values from column A to F.

    i can do it manually each time, but what if new rows added? i need some macro to do the sort then to check and do all define names in same sheet in my criteria.

    thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Define New Names for Specific Cells

    Hi

    I don't know what Z_1 is about so I leave you to sort out.

    The rest is sorted by this workbook.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Define New Names for Specific Cells

    hi,

    i think that i have to explain more, i have two idea to solve my problem but i dont know will be solved by formula or macro,

    first;
    i need to sort data in column (lowest to highest), then making the define name using arrays, lets say that after sorting i have Value="A-1" in 16 rows, so i need array to select these 16 rows. if i add one row later on which include value "A-1", again will sort....define name....17 rows will be selected in array.

    second;

    i have in sheet one, in Cell: A1, A-1 as a Value.
    i want to click on this Cell which contains A-1, will hyperlink to the second sheet and filter column A with the data value matching with Cell A-1 from the first sheet.


    i think first one will be macro and second one will be formula, and i prefer the formula

    many thanks in advance

  4. #4
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Define New Names for Specific Cells

    any help please?

  5. #5
    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: Define New Names for Specific Cells

    Hi boss1982

    The Code in the attached does this
    sort data in column (lowest to highest)
    and Creates Named Ranges.

    It also creates Hyperlinks but I don't understand what it is you wish to do with them.

    The Code has been assigned a keyboard shortcut of CTRL+y.
    Attached Files Attached Files
    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.

  6. #6
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Define New Names for Specific Cells

    hi jaslake,

    actually if i add another row in "before" sheet, will not appear in "after" sheet, lets add duplicate A-18 row and run the macro, it will appear one time only.

    ok, please just i need a macro will check all data in "before" sheet and will do;

    1- sort (lowest to highest)
    2- re-assign the names to include all new data (rows)

    forget about "after" sheet, and about the hyperlinks, i will do it manually later on like to click on for example B-2 in another sheet (i will create it as a master list), will hyperlink to all B-2 in A column, and just to select them from column A to column F.

    thanks.

  7. #7
    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: Define New Names for Specific Cells

    Hi boss1982

    The Code runs on the "After" Sheet.
    Please Login or Register  to view this content.
    You can change this to whatever you wish. The "Before" Sheet does not get affected in any way so I eliminated it. If you add lines to the "After" Sheet they get sorted properly and the Named Ranges get redefined.

    If you don't want the Hyperlinks simply comment out these Code lines
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Define New Names for Specific Cells

    thanks a lot john

    just i have one question;

    what about if i have header in my table and i dont want to do anything with?

    thanks.

  9. #9
    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: Define New Names for Specific Cells

    Hi boss1982

    Probably like this
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Define New Names for Specific Cells

    please tell me what are the changes u did in the code u gave me in post no. 7?

  11. #11
    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: Define New Names for Specific Cells

    Hi boss1982

    You have both sets of Code. Print them both out then compare them...that's what I'd need to do.

  12. #12
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Define New Names for Specific Cells

    thank you

    i know that, i was asking you just to double check what u changed, because the new code will refer all the define names to "$E$5781:$F$5781"

    and row no. 5781 is the last row in my sheet

    please double check if you dont mind.
    Last edited by boss1982; 04-01-2013 at 03:59 AM.

  13. #13
    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: Define New Names for Specific Cells

    Hi boss1982

    Sorry, I didn't realize you were having an issue with the Code. Now I see what the issue is. Try this
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Define New Names for Specific Cells

    thanks a lot john
    it is perfect now

  15. #15
    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: Define New Names for Specific Cells

    You're welcome...glad I could help. Thanks for the Rep.

+ Reply to 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