Question: The file Formatting 2 . xlsm contains the following code for formatting some data. This code works perfectly well, but it is quite repetitive. Rewrite

The file Formatting 2.xlsm contains the following code for formatting some
data. This code works perfectly well, but it is quite repetitive. Rewrite it by using
as many With constructions as make sense, using apropriate indentation, and
then run your modified code to make sure it still works.
Sub Formatting0
ActiveWorkbook.Worksheets("Sheet1").Range("A1").Font.Bold=True
ActiveWorkbook.Worksheets("Sheet1").Renge("A1").Font.Size=14
ActiveWorkbook.Worksheets("Sheet1").Range("A1").HorizontalAlignment=xILeft
ActiveWorkbook.Worksheets("Sheet1").Range("A3:A6").Font.Bold=True
ActiveWorkbook.Worksheets("Sheet1").Range("A3:A6").Font.Italic=True
ActiveWorkbook.Worksheets("Sheet1").Range("A3:A6").Font.Color=vbGreen
ActiveWorkbook.Worksheets("Sheet1").Range("A3:A6").Insertindent1
ActiveWorkbook.Worksheets("Sheet1").Range("B2:D2").Font.Bold-True
ActiveWorkbook.Worksheets("Sheet1").Range("B2:D2").Font.Italic=True
ActiveWorkbook.Worksheets("Sheet1").Range("B2:D2").Font.Color=vbBlue
ActiveWorkbook.Worksheets("Sheet1").Range("B2:D2").HorizontalAlignment=xIRight
ActiveWorkbook.Worksheets("Sheet1").Range("B3:D6").Font.Color=vbRed
ActiveWorkbook.Worksheets("Sheet1").Range("B3:D6").NumberFormat="$#,##0"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!