Sub UnitMixFormatting()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+Shift+D
'
Dim wsName As String
' REPEATER
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
' END
' Start CODE
Range("A1").Select
Cells.Find(What:="SECTION II", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Rows("1:783").EntireRow.Select
Selection.ClearContents
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.End(xlUp).Select
ActiveWindow.SmallScroll Down:=-6
Selection.ClearContents
Application.Goto Reference:="R1C1"
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Offset(4, 0).Range("A1:N1").Select
Selection.ClearContents
ActiveCell.Offset(0, 11).Columns("A:A").EntireColumn.Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Application.Goto Reference:="R1C1"
' 3
' Delete top row????
ActiveCell.Offset(0, 1).Range("A1").Select
Application.Goto Reference:="R1C1"
ActiveCell.Range("A1:O1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Application.Goto Reference:="R5C1"
ActiveCell.Offset(-2, 0).Range("A1:A3").Select
ActiveCell.Activate
Selection.Merge
Application.Goto Reference:="R5C2"
ActiveCell.FormulaR1C1 = "Description"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C3"
ActiveCell.FormulaR1C1 = "Sq"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C3"
ActiveCell.FormulaR1C1 = "Ft"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C4"
ActiveCell.FormulaR1C1 = "Rent"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C4"
ActiveCell.FormulaR1C1 = "Rate"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C5"
ActiveCell.FormulaR1C1 = "Rent"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C5"
ActiveCell.FormulaR1C1 = "Per"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R5C5"
ActiveCell.FormulaR1C1 = "SqFt"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C6"
ActiveCell.FormulaR1C1 = "#"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C6"
ActiveCell.FormulaR1C1 = "Units"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C7"
ActiveCell.FormulaR1C1 = "Total"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C7"
ActiveCell.FormulaR1C1 = "SqFt"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C8"
ActiveCell.FormulaR1C1 = "Occupied"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C8"
ActiveCell.FormulaR1C1 = "Units"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C9"
ActiveCell.FormulaR1C1 = "Vacant"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C9"
ActiveCell.FormulaR1C1 = "Units"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C10"
ActiveCell.FormulaR1C1 = "Damaged"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C10"
ActiveCell.FormulaR1C1 = "Units"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C11"
ActiveCell.FormulaR1C1 = "Occupied"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C11"
ActiveCell.FormulaR1C1 = "SqFt"
' Hey
Application.Goto Reference:="R5C1"
ActiveCell.FormulaR1C1 = "Size"
' Hey
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C12"
ActiveCell.FormulaR1C1 = "%"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C12"
ActiveCell.FormulaR1C1 = "x"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R5C12"
ActiveCell.FormulaR1C1 = "xxx"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C13"
ActiveCell.FormulaR1C1 = "%"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C13"
ActiveCell.FormulaR1C1 = "x"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R5C13"
ActiveCell.FormulaR1C1 = "xx"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C14"
ActiveCell.FormulaR1C1 = "xxx"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C14"
ActiveCell.FormulaR1C1 = "x"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R3C15"
ActiveCell.FormulaR1C1 = "xxx"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R4C15"
ActiveCell.FormulaR1C1 = "x"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R5C15"
ActiveCell.FormulaR1C1 = "xx"
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R1C1"
ActiveCell.Range("A1:O5").Select
Selection.Font.Bold = True
ActiveCell.Offset(1, 0).Range("A1").Select
Application.Goto Reference:="R1C1"
' 4
Application.Goto Reference:="R6C12"
ActiveCell.FormulaR1C1 = "=RC[-1]/RC[-5]"
ActiveCell.Offset(1, -1).Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "x"
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "x"
ActiveCell.Offset(0, -1).Range("A1").Select
Selection.End(xlUp).Select
Application.Goto Reference:="R6C16"
ActiveCell.FormulaR1C1 = "=RC[-3]/100"
ActiveCell.Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(0, -3).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.Goto Reference:="R6C12"
Application.CutCopyMode = False
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Application.Goto Reference:="R6C16"
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.ClearContents
Application.Goto Reference:="R1C1"
Application.Goto Reference:="R6C12"
ActiveCell.Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Application.Goto Reference:="R1C1"
' NEW STUFF - SUBTOTALS
Range("F" & Rows.Count).End(xlUp).Offset(2).Formula = "=SUBTOTAL(109,R6C:R[-2]C)"
Range("G" & Rows.Count).End(xlUp).Offset(2).Formula = "=SUBTOTAL(109,R6C:R[-2]C)"
Range("H" & Rows.Count).End(xlUp).Offset(2).Formula = "=SUBTOTAL(109,R6C:R[-2]C)"
Range("I" & Rows.Count).End(xlUp).Offset(2).Formula = "=SUBTOTAL(109,R6C:R[-2]C)"
Range("J" & Rows.Count).End(xlUp).Offset(2).Formula = "=SUBTOTAL(109,R6C:R[-2]C)"
Range("K" & Rows.Count).End(xlUp).Offset(2).Formula = "=SUBTOTAL(109,R6C:R[-2]C)"
Range("N" & Rows.Count).End(xlUp).Offset(2).Formula = "=SUBTOTAL(109,R6C:R[-2]C)"
Range("O" & Rows.Count).End(xlUp).Offset(2).Formula = "=SUBTOTAL(109,R6C:R[-2]C)"
' END SUBTOTALS
Application.Goto Reference:="R6C1"
Selection.End(xlDown).Select
ActiveCell.Offset(2, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "Totals"
ActiveCell.Offset(0, 5).Range("A1").Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Style = "Percent"
With Selection.Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Selection.NumberFormat = "0.0%"
ActiveCell.FormulaR1C1 = "=RC[-1]/RC[-5]"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=RC[-5]/RC[-7]"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Application.Goto Reference:="R6C1"
Selection.End(xlDown).Select
Selection.End(xlDown).Select
ActiveCell.Range("A1:O1").Select
Selection.Font.Bold = True
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Application.Goto Reference:="R6C1"
Selection.End(xlDown).Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 11).Range("A1:B1").Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Application.Goto Reference:="R1C1"
'Add in FIX Income Column formatting
Application.Goto Reference:="R2000C14"
Selection.End(xlUp).Select
ActiveCell.Range("A1:B1").Select
Selection.Style = "Currency"
Selection.NumberFormat = "_($* #,##0.0_);_($* (#,##0.0);_($* ""-""??_);_(@_)"
Selection.NumberFormat = "_($* #,##0_);_($* (#,##0);_($* ""-""??_);_(@_)"
Application.Goto Reference:="R1C1"
' DONE
' END MAIN CODE
' REPEATER
Next
' DONE
'Add in Fix Tab Names
For Each ws In Worksheets
If ws.Name Like "######*" Then
wsName = ws.Name
wsName = Left(wsName, 6)
ws.Name = wsName
End If
Next
'Done
'Add in Title From Worksheet
For Each ws In Worksheets
ws.Range("A1").Value = ws.Name
Next
'Done
End Sub