Changing Font when inputting via VBA

Guntherm

New Member
Joined
Mar 12, 2009
Messages
15
Okay,

I am opening a Word Documnet and reading the tables within and then copying certain info into excel.

Question. the info I am gettign is in mulitple areas and have no problems gettign the info, however some of the info I am getting is basically a header. So I want to change to font to Bold on certain parts of the inputting process.
If you look at each strBuild It has something in quotes. Those pieces need to be bold and the rest of the text I am bringing in should be regular.

This is an example of what I want it to be at the end of this:

XXXXX-1-1: (Control Board)
Procedure Objective:
To ensure that the system is under the control of a Control Board that meets regularly IAW Local Policy.
Procedure Preparation:
Obtain a copy of the Plan, the Control Board and the most recent minutes from the previous meetings.
Procedure Script:
1. Review the plan and board plan to ensure the information system is under the control of a board.
2. Ensure all meeting are being held.

<Source Code>

If .Selection <> Chr(13) & Chr(7) Then
strbuild = strbuild & ": (" & ParseOut & ")" & Chr(10)
.Selection.MoveRight Unit:=wdCell, Count:=1
'Must add formating to text
.Selection.Font.Bold = True
ParseOut = .Selection
Call ParseIT(ParseOut)
strbuild = strbuild & "Procedure Objective:" & Chr(10) & ParseOut & Chr(10)
shtIAControls.Cells(intRow, 14) = strbuild

.Selection.Font.Bold = False
shtIAControls.Cells(intRow, 14) = shtIAControls.Cells(intRow, 14).Value & .Selection
'add more info
.Selection.MoveRight Unit:=wdCell, Count:=1
ParseOut = .Selection
Call ParseIT(ParseOut)
strbuild = strbuild & "Procedure Preparation:" & Chr(10) & ParseOut & Chr(10)
'add more info
.Selection.MoveRight Unit:=wdCell, Count:=1
ParseOut = .Selection
Call ParseIT(ParseOut)
strbuild = strbuild & "Procedure Script:" & Chr(10) & ParseOut & Chr(10)
'add more info
.Selection.MoveRight Unit:=wdCell, Count:=1
ParseOut = .Selection
Call ParseIT(ParseOut)
strbuild = strbuild & "Expected Results:" & Chr(10) & ParseOut & Chr(10)
shtIAControls.Cells(intRow, 14) = strbuild

<End of Source Code>
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top