+ Reply to Thread
Results 1 to 21 of 21

Format cell text differently

  1. #1
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Format cell text differently

    Hi sorry for the brief title I am not sure what it is called that I am after!

    OK so I have set up an approval button with a macro linked to it and everything which is working fine. However the macro looks up the username of the authoriser which then shows in say cell A1 as first.lastname format. How do I have another format behind the scenes to actually change this to First LastName format...

    so rather than joe.blogs to Joe Blogs.

    Also while we are on the subject I want the cell to actually say Joe Blogs 15/01/2015 09:15 in the box to show the exact date and time it was approved also but cannot figure this out in the macro!

    HEEEEEELP. As a temporary measure the first query is more of a burden for me as I don't want it showing as joe.blogs as it looks tacky.

    Thanks
    Alun

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    Formula, for joe.blogs in cell A1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Format cell text differently

    Thanks Trevor will try it Monday and get back to you. Perhaps know how I can get the name date and time in 1 cell too?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    Well, with a formula, you could have:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    But that would change every time you recalculated. So you'd have to copy it and paste special values. Probably best to use a VBA worksheet change event handler ... but do you want VBA?

    Regards, TMS

  5. #5
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Format cell text differently

    VBA would be good yes please

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    Ok, tomorrow, if I have any time. Otherwise I'll get back on Monday.

    Would be helpful to have a sample workbook with the button and code (and some typical data)

    Regards, TMS

  7. #7
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Format cell text differently

    Sure - I can do that - where shall I email the file?

    Thanks again

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    Please upload a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  9. #9
    Registered User
    Join Date
    01-16-2015
    Location
    Pakistan
    MS-Off Ver
    2016
    Posts
    31

    Re: Format cell text differently

    Dear Hi,
    I think that u better use, In the HOME Tab(Goto Styles then select Format As Table) and select a format which you like, then make use of design tab(banded rows & columns) to format as u require.......

    if it works plz respond positively and clik on add reputation

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    Maybe you can incorporate this into your existing code:

    Please Login or Register  to view this content.

    Regards, TMS

  11. #11
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Format cell text differently

    QC Localised TEST2.xlsm

    Sorry for the delay. File should now be attached. Basically on the header tab cells 32-36 are formula driven based off another tab. I want the approval buttons to find the user name, date and time (example shown in column I to automatically populate in cells C38 C40 C42. I have managed to start getting approval buttons 2 and 3 to work as a starting point however approval 1 wont play ball!! If possible what I would like at the end of having that is to have within the macro to lock cells C38 C40 and C42 to that date and time so when the spreadsheet is opened in the future these wont change.

    Hope this makes sense. Shout if not.

  12. #12
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Format cell text differently

    another quicker query (I hope)

    I have a massive spreadsheet of data whereby a whole column of codes look like this CPRGMAPS000001B3.

    Is there a quick formula I can put it to make the format XXXX_XXXX_XXXXXX_XX

    So CPRG_MAPS_000001_B3

    Otherwise I have to manually change over 1000 lines....

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    Please Login or Register  to view this content.

    Please see updated sample workbook.


    Regards, TMS
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Format cell text differently

    Thanks however I have noticed 1 problem.... if I need 2 approvals by 2 different people, when the second person approves it overwrites the first person?

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    I just modified your existing code to put the formatted name in the next cell to where your buttons currently output the login ID. You have three buttons for three approvers. I haven't changed that.

    Button 4 was just to demonstrate a more generic approach ... but you would have to select the correct row.

  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    With regard to your other query, it should really be a separate thread ... different question altogether.

    However, you could use LEFT, MID, and RIGHT to extract the parts of the code and concatenate them into a helper column. Then you copy those values and Paste Special | Values over the original. Then delete the helper column.

    Regards, TMS

  17. #17
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Format cell text differently

    OK so how can I lock the time to each individual button?

  18. #18
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    how can I lock the time to each individual button?
    I don't understand the question.

    What do you want to happen?

  19. #19
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Format cell text differently

    At the moment, if you click on any of the approval buttons it all states say 12:02 - then in say 2 mins I reclick 1 to test it, and all 3 change to 12:04 when say approver 1 may authorise yesterday, with the second today... etc

  20. #20
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Format cell text differently

    Heh, heh ... that's just the original formula in column I that uses NOW(). Always a problem

    The code actually puts the login ID in column K and the formatted and time stamped version in column L. However, both cells are formatted with white font and interior colour ... I had assumed that was what you wanted/needed as the sheet is formatted that way. If you want them visible, you could make the font vbBlack.

    Neater code:

    Please Login or Register  to view this content.

  21. #21
    Registered User
    Join Date
    06-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Format cell text differently

    ok shall I post this query somewhere else? or if its ok could you provide me with the LEFT, MID, RIGHT codes as I dont know what they are? (sorry)

+ 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] Pulling specific text within a text in which the information is typed differently
    By djmatok in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-02-2014, 06:11 PM
  2. [SOLVED] need to format a cell to change cell color & display entry differently
    By dnsmc in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-28-2013, 11:10 AM
  3. [SOLVED] FORMAT SECTIONS OF CELL FORMULA DIFFERENTLY
    By Takeadoe in forum Excel General
    Replies: 3
    Last Post: 07-13-2006, 11:25 AM
  4. How do you format each slice differently in a 3-D pie chart?
    By Old School in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-26-2006, 08:35 PM
  5. Replies: 1
    Last Post: 07-28-2005, 08:05 PM

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