+ Reply to Thread
Results 1 to 11 of 11

Add unique value automatically to sheets("to.") and sheets("total")

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    Add unique value automatically to sheets("to.") and sheets("total")

    hi, everyone

    i have three worksheets on my workbook
    1 = "TO."
    2 = "ENTRY"
    3 = "TOTAL"

    I add data sheets("entry").range("c10:c300"). so when i add data here then automatically add same but unique to sheets("to.").range("b4:b100") and sheets("total").range("c4"c100")

    for example
    i add "haroon" in range sheets("entry").range("c10:c300")

    then "haroon" auto add to sheets("to.") and sheets("total") in range

    if "haroon" already added in sheets("to.") and sheets("total") then ignore it


    I Think this will done with worksheet_change event
    Please Login or Register  to view this content.

    thanx a lot
    Attached Files Attached Files
    Last edited by HaroonSid; 02-04-2017 at 05:55 AM.
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    Done it in 2 different ways so you can choose.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    Thank you Forum Expert once again

    working perfectly as i wanted

    but i have one more question, if i want to use NameRange instead of simple range
    i mean

    "ABD" for sheets("to.").range("b4:b100")

    "ABE" for sheets("total").range("c4"c100")
    Last edited by HaroonSid; 02-04-2017 at 11:15 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,241

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 02-04-2017 at 12:20 PM. Reason: Please use code tags!

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    Hello daboho,

    Please when you are posting any Code ensure you use Code Tags.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    Thank you.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    Try this.
    Add following code to Standard module.

    Please Login or Register  to view this content.
    Then in Sheet module.

    Please Login or Register  to view this content.
    Last edited by bakerman2; 02-04-2017 at 10:15 PM.

  7. #7
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    Thanx a lot dear bakerman2 once again

    its working perfectly



    you solved my big problem

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    You're welcome and thanks for adding rep points. (again )

  9. #9
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    Hey bakerman2 u deserve better then rep+

    btw dear i am getting little problem here

    this code is slow. should i use "Application.EnableEvents" here or any other idea?

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    Hey bakerman2 u deserve better then rep+

    btw dear i am getting little problem here

    this code is slow. should i use "Application.EnableEvents" here or any other idea?

    Please Login or Register  to view this content.

  11. #11
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Add unique value automatically to sheets("to.") and sheets("total")

    If there are a lot of formulas involved you could start by setting calculation to manual at the start. (don't forget to reset at the end)
    Also instead of searching entire column you could search in Named Range only. (see Post#6)

+ 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: 03-09-2016, 12:17 PM
  2. Replies: 1
    Last Post: 06-06-2013, 06:28 PM
  3. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  4. [SOLVED] Need Macro to compile data from "Weekly" sheets and sum up into "Monthly" summary sheet
    By mo4391 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-21-2013, 07:25 PM
  5. [SOLVED] Sheets("Sheet2").Range("AA1") = "Note"
    By dcburkejr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-03-2012, 04:10 PM
  6. "The "sheets" method from the "_Global" object have failed."
    By mankit87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2011, 08:53 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