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 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 Formatting
ActiveWorkbook.WorksheetsSheetRangeAFont.BoldTrue
ActiveWorkbook.WorksheetsSheetRengeAFont.Size
ActiveWorkbook.WorksheetsSheetRangeAHorizontalAlignmentxILeft
ActiveWorkbook.WorksheetsSheetRangeA:AFont.BoldTrue
ActiveWorkbook.WorksheetsSheetRangeA:AFont.ItalicTrue
ActiveWorkbook.WorksheetsSheetRangeA:AFont.ColorvbGreen
ActiveWorkbook.WorksheetsSheetRangeA:AInsertindent
ActiveWorkbook.WorksheetsSheetRangeB:DFont.BoldTrue
ActiveWorkbook.WorksheetsSheetRangeB:DFont.ItalicTrue
ActiveWorkbook.WorksheetsSheetRangeB:DFont.ColorvbBlue
ActiveWorkbook.WorksheetsSheetRangeB:DHorizontalAlignmentxIRight
ActiveWorkbook.WorksheetsSheetRangeB:DFont.ColorvbRed
ActiveWorkbook.WorksheetsSheetRangeB:DNumberFormat$###
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
