greeting to all of you
i'm a beginner of vba, i've recorded some macro below to run my workbook, but i got some error with the outcome, can anyone with your kind guidance help me out?
my expectation are:
~ row 1 height was 100 instead of frist 3 rows
~ column A:H width was 80 instead of column D only 80 (*even column G:H width should be 15)
~ cell B1:F1 & cell B5:F5 should merged
*font size should be correct now
what did i wrong?
appreciate for the poor english
i'm a beginner of vba, i've recorded some macro below to run my workbook, but i got some error with the outcome, can anyone with your kind guidance help me out?
my expectation are:
~ row 1 height was 100 instead of frist 3 rows
~ column A:H width was 80 instead of column D only 80 (*even column G:H width should be 15)
~ cell B1:F1 & cell B5:F5 should merged
*font size should be correct now
what did i wrong?
appreciate for the poor english
VBA Code:
Sub Macro1()
'
' Macro1 Macro
'
'
ActiveWorkbook.Sheets.Select
Cells.Select
Cells.EntireRow.AutoFit
Rows("9:38").Select
Selection.RowHeight = 30
Rows("1:1").Select
Selection.RowHeight = 100
Columns("G:H").Select
Selection.ColumnWidth = 15
Range("B1").Select
With Selection.Font
.Name = "Calibri"
.Size = 80
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = -16777216
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("B1:F1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("B5:F5").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Columns("B:B").EntireColumn.AutoFit
Columns("D:D").Select
Range("D2").Activate
Selection.ColumnWidth = 80
Range("A1").Select
End Sub