#1
|
|||
|
|||
format text with VBA
Hi All I'm trying to format a part of text using the code below I'm getting several pieces of information from various cells, with one of them i am trying to make it bold text. Can this be done this way wrapping the code in the format function, the same way i did it with the serial number field. If so how ???
I have tried various syntax and checked online for some help to no avail. Any assistance is appreciated. regards Trevor Code:
Set AcRow = ActiveCell.EntireRow If Not Intersect(Target, Sh.Range("AK4:AK5000")) Is Nothing Then ' note for online payments ActiveCell.FormulaR1C1 = "Date :- " & Date & " , " & Intersect(AcRow, tblColumns("Company Name").Range) & " INV Number :- " & Intersect(AcRow, tblColumns("Xero Invoice Number").Range) & _ ", Repairs to Clipsal C-bus Wall Unit " & Intersect(AcRow, tblColumns("Part").Range) & " " & " S/N " & _ Format(Intersect(AcRow, tblColumns("Serial Number").Range), "000000000000") & " On " & Intersect(AcRow, tblColumns("RMA Number").Range) Exit Sub End If |
#2
|
|||
|
|||
Couldn't wait, found a workaround that works for me...
Code:
With ActiveCell fst = InStr(8, ActiveCell, ":") 'Format INV BOLD .Characters(fst + 3, ActiveCell.Characters.Count - 4).Font.Bold = True .Characters(fst + 7, ActiveCell.Characters.Count).Font.Bold = False 'Format INV number size .Characters(fst + 3, ActiveCell.Characters.Count - 4).Font.Size = 20 .Characters(fst + 7, ActiveCell.Characters.Count).Font.Size = 11 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find text, format part of text in italic | d4okeefe | Word VBA | 18 | 06-30-2022 11:35 PM |
Macro to find text in between two characters and then format selected text? | qcom | Word | 5 | 02-19-2015 11:23 PM |
How to format text in a CELL? | Learner7 | Excel | 3 | 08-06-2012 03:52 AM |
text format | bkcell | Word | 2 | 07-15-2011 04:59 PM |
Objective: Automatically export email text,attachment text to DB friendly format | SilentLee | Outlook | 0 | 11-14-2010 02:45 PM |