Results 1 to 9 of 9

Underline a specific part of a text string (inc formulas) using VBA.

Threaded View

  1. #1
    Registered User
    Join Date
    01-25-2018
    Location
    london
    MS-Off Ver
    365
    Posts
    43

    Underline a specific part of a text string (inc formulas) using VBA.

    Hey all,

    Currently I'm working on a question that i'd like to look like this:
    What is the value of the underlined digit in 8512?

    The digit i'd like to underline is in cell X6 and the text string is in cell C9 (the formula for which is ="What is the value of the underlined digit in "&Y6&"?")

    I'd like to have VBA code that is dynamic and picks up that i want "5" underlined from cell X6 and does it in cell C9.

    I've also got a range of data (so, i'd like this to be applied to all of the range too) the value I want underlined from X6:X45 and the questions in the range C9:C48.

    I found this about underlining in a string and tried to have a go myself,

    Sub test()
    Range("A1") = "The quick brown fox jumps over the lazy dog."
    Range("A1").Characters(17, 13).Font.Underline = True
    End Sub
    but I've got no idea how to adapt this as my vba is really not good enough!

    Can anyone help please?
    Last edited by Oriya; 08-06-2019 at 04:32 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] duplicate specific text and underline it
    By Ethen5155 in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2019, 12:31 PM
  2. Replies: 2
    Last Post: 03-18-2015, 07:30 PM
  3. [SOLVED] Delete a row if a cell contains certain text as part of a text string
    By Steve2107 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2014, 07:49 PM
  4. [SOLVED] Can I remove the first part of a string of text and keep the second part?
    By Whoop92 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 02-12-2014, 07:44 PM
  5. Match text in A1 to a part of a text string in B1 and enter data D1
    By markDuffy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2013, 10:16 PM
  6. [SOLVED] Extracting specific part of the text string to another column
    By ssanjju in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 01-20-2013, 07:20 PM
  7. Finding specific text in string - Part II
    By Hardip in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-08-2006, 09:25 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