Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2020, 09:50 PM
trevorc trevorc is offline format text with VBA Windows 7 32bit format text with VBA Office 2013
Competent Performer
format text with VBA
 
Join Date: Jan 2017
Posts: 174
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default 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
Reply With Quote
  #2  
Old 05-26-2020, 10:27 PM
trevorc trevorc is offline format text with VBA Windows 7 32bit format text with VBA Office 2013
Competent Performer
format text with VBA
 
Join Date: Jan 2017
Posts: 174
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
format text with VBA 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
format text with VBA 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft