[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VBscript ability to control formatting?

Posted on 2016-10-12
2
Medium Priority
?
57 Views
Last Modified: 2016-10-16
Can VBscript control things like formatting (bolding, adding cell borders, wrapping text on certain fields, etc.). If so, what functions are available?
0
Comment
Question by:Judy Deo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Assisted Solution

by:Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs) earned 600 total points
ID: 41841342
The broad answer is yes. VBA can do just about everything you can do manually in Excel, plus more. For specifics about formatting cells it's probably best to point you toward the official documentation of the Range object. Browse through the Properties at the bottom.

https://msdn.microsoft.com/en-us/library/office/ff838238.aspx?f=255&MSPPError=-2147217396
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 1400 total points
ID: 41841344
You probably mean VBA not VBscript which is a standalone scripting language.
The answer to your question is anything you can do using Excel's GUI can be done using VBA.
Here are some examples for formatting the font:
' set font properties
Selection.Font.Name = "Rockwell Condensed"
Selection.Font.Bold = True
Selection.Font.Italic = True
Selection.Font.Strikethrough = True
Selection.Font.Size = 45
Selection.Font.ThemeColor = 5
Selection.Font.Color = vbBlue

Open in new window

p.s. instead of selection you can (and should use the range object, i.e.
' set font properties
Range("A1").Font.Name = "Rockwell Condensed"
Range("A1:B5").Font.Bold = True
Range("A1:B5").Font.Italic = True
Range("A1:B5").Font.Strikethrough = True
Range("A1:B5").Font.Size = 45
Range("A1:B5").Font.ThemeColor = 5
Range("A1:B5").Font.Color = vbBlue

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question