ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   format text through vba (https://www.excelbanter.com/excel-programming/372478-format-text-through-vba.html)

Steve

format text through vba
 
I use the following code to insert a line of text into a quote sheet:

Worksheets(QuoteForm).Range("A" & DataRow).Value = "Additional Delivery Fee
of $" & Worksheets("Calculations").Range("PartialFreightPr ice").Text & " /
Delivery if customer request additional deliveries"

Is there a way I can make the
Worksheets("Calculations").Range("PartialFreightPr ice").Text BOLD?



NickHK[_3_]

format text through vba
 
Steve,
You have to work with the .characters property of the range, similar to
MID( ).
Something like this :

dim PriceStr as string
const Msg as string=""Additional Delivery Fee of $"
pricestr=Worksheets("Calculations").Range("Partial FreightPrice").Text
With Worksheets(QuoteForm).Range("A" & DataRow)
.Value = Msg & pricestr & " / Delivery if customer request additional
deliveries"
.Characters(len(msg)+1,len(pricestr).font.bold=tru e
end with

NickHK

"steve" ...
I use the following code to insert a line of text into a quote sheet:

Worksheets(QuoteForm).Range("A" & DataRow).Value = "Additional Delivery
Fee
of $" & Worksheets("Calculations").Range("PartialFreightPr ice").Text & " /
Delivery if customer request additional deliveries"

Is there a way I can make the
Worksheets("Calculations").Range("PartialFreightPr ice").Text BOLD?





Steve

format text through vba
 
very nice....thank you!

"NickHK" wrote:

Steve,
You have to work with the .characters property of the range, similar to
MID( ).
Something like this :

dim PriceStr as string
const Msg as string=""Additional Delivery Fee of $"
pricestr=Worksheets("Calculations").Range("Partial FreightPrice").Text
With Worksheets(QuoteForm).Range("A" & DataRow)
.Value = Msg & pricestr & " / Delivery if customer request additional
deliveries"
.Characters(len(msg)+1,len(pricestr).font.bold=tru e
end with

NickHK

"steve" ...
I use the following code to insert a line of text into a quote sheet:

Worksheets(QuoteForm).Range("A" & DataRow).Value = "Additional Delivery
Fee
of $" & Worksheets("Calculations").Range("PartialFreightPr ice").Text & " /
Delivery if customer request additional deliveries"

Is there a way I can make the
Worksheets("Calculations").Range("PartialFreightPr ice").Text BOLD?







All times are GMT +1. The time now is 11:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com