+ Reply to Thread
Results 1 to 14 of 14

If Statement or Macro to add a * at End of Text if Something is True

  1. #1
    Registered User
    Join Date
    12-22-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    25

    If Statement or Macro to add a * at End of Text if Something is True

    Please find the attached Excel Spreedsheet named Sample.

    I need to have a * added at the end of my name, but have it added only if "UnPaid" is selected from the dropdown list below it. What is the best way to do this?


    Thank you,

    John
    Attached Files Attached Files

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

    Re: If Statement or Macro to add a * at End of Text if Something is True

    Hello JohnMaier,

    Maybe as per the attached WorkBook?

    Also see the "Please consider" note at the bottom of this post.
    Attached Files Attached Files
    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] .

  3. #3
    Registered User
    Join Date
    12-22-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: If Statement or Macro to add a * at End of Text if Something is True

    Winon,

    This is great and works well, but is not exactly what I am needing. My apologies for not providing more detail. I need to be able to change the name in A1 as well, and still have the * added if "unpaid" is selected in A5.

    Thank you a TON for all of your help!

    Regards,

    John

  4. #4
    Registered User
    Join Date
    12-22-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: If Statement or Macro to add a * at End of Text if Something is True

    Here is a better example of what it is I am trying to do. See "Testbook" attached, 2nd tab.

    In the attached, I have three sections with the name, DOB, Address, and Payment Status in Column A.

    In Column D, I have entered the formula to add the * to the name if Unpaid is selected.

    What I need is for the results of this formula to then show up in A1 for John, A7 for BOB, or A13 for Tim.

    I need to be able to copy this down and add more people if needed.


    Thanks to all who view.

    Regards,

    John
    Attached Files Attached Files

  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: If Statement or Macro to add a * at End of Text if Something is True

    Hello JohnMaier,

    Then I would keep it simple and do it as per the attached WorkBook.
    Attached Files Attached Files

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

    Re: If Statement or Macro to add a * at End of Text if Something is True

    On second thoughts, why don't you just use Conditional Formatting?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-22-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: If Statement or Macro to add a * at End of Text if Something is True

    Thank you for your assistance, but I think I may need to use a macro to obtain the results I need. I like the idea of conditional formatting, but the * is a standard in our officue used to indicate status.

    Wouldn't the code look somthing like this?

    Please Login or Register  to view this content.
    Thank you again for the help!

    Regards,

    John
    Last edited by JohnMaier; 04-12-2013 at 03:38 PM. Reason: updating code section

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

    Re: If Statement or Macro to add a * at End of Text if Something is True

    You are welcome!

    Just Clear the Conditional Formatting, and the Formulas will take care of the rest, no mateer how far you copy it down, while your Code above caters for only one instance.

    It is always much better to use built in Excel functions or formulas as opposed to VBA.

  9. #9
    Registered User
    Join Date
    12-22-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: If Statement or Macro to add a * at End of Text if Something is True

    The problem is: That the cell containing the Name, shows up on other sheets via formula (e.g. =('Sheet1'!$B$1)), so I need the * to show up in that same cell.

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

    Re: If Statement or Macro to add a * at End of Text if Something is True

    Then perhaps maybe something like the attached?
    Attached Files Attached Files

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

    Re: If Statement or Macro to add a * at End of Text if Something is True

    Hello JohnMaier,

    I had another look at your issue, and decided to go with VBA for a solution.

    Please try the attached WorkBook.

    I have also "Jacked-up" your Code for the "Above or Below" Sheet. Give it also a try, and please let me know if your issue has been resolved
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-22-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: If Statement or Macro to add a * at End of Text if Something is True

    YES! This is exactly what I needed!

    Thank you for all of your help!

    Regards,

    John

    [SOLVED]

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

    Re: If Statement or Macro to add a * at End of Text if Something is True

    Hello JohnMaier,

    You are welcome.

    Thank you for the Rep.

    Please stay in touch.

    Kind Regards

  14. #14
    Registered User
    Join Date
    12-22-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: If Statement or Macro to add a * at End of Text if Something is True

    Winon,

    I am attampting to include the macro you helped me with as a part of another workbook I created, and have run into some issues.

    1. I have NO idea what I am doing!!

    2. I am trying to include the macro as part of a larger macro within the ACCT DATA sheet. This macro operates the market sheet selection in cell D13, allows for mutilple selections within the dropdowns in all rows after 13, and now, I am adding the "*" bit to the end.

    3. I am trying to avoid having the macro copy the text to a cell to the far right. It would be fine if it was only myself using the workbook, but others will be using it and will not know the data is being copied there. This may cause some problems if they try to delete rows, columns, etc. Can this data be coppied onto the sourse sheet?

    4. Like your original macro, I need it to remove the "*" if say, you select non-admitted which adds the *, but then select admitted after.

    5. It is a little buggy. It freezes Excel if I attempt to delete a Post Binding Section (e.g. rows 57-75 of the ACCT DATA sheet)

    Could you PLEASE PLEASE PLEASE help me!?

    If none of this makes sense, please let me know and I will attempt to explain a little better.

    Thank you, Winon!!

    Regards,

    John
    Attached Files Attached Files

+ 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