Sub Variancesinserting()
'
' Variancesinserting Macro
'
'
With Worksheets(ThisWorkbook.Worksheets("Variables").Range("A7").Value & " " & ThisWorkbook.Worksheets("Variables").Range("A14").Value & " IDARRS")
If .AutoFilterMode Then
If .FilterMode Then
.ShowAllData
End If
Else
If .FilterMode Then
.ShowAllData
End If
End If
End With
Sheets("CARS TO HQARS BUMP").Select
Range("C44:C70").Select
Selection.Copy
Sheets(ThisWorkbook.Worksheets("Variables").Range("A7").Value & " " & ThisWorkbook.Worksheets("Variables").Range("A14").Value & " IDARRS").Select
' With Worksheets(ThisWorkbook.Worksheets("Variables").Range("A7").Value & " " & ThisWorkbook.Worksheets("Variables").Range("A3").Value & " IDARRS")
' If .AutoFilterMode Then
' If .FilterMode Then
' .ShowAllData
' End If
' Else
' If .FilterMode Then
' .ShowAllData
' End If
' End If
'End With
Dim lRow As Long
'Find the last non-blank cell in column A(1)
lRow = (Cells(Rows.Count, 10).End(xlUp).Row + 1)
Range("J" & lRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("K" & lRow).Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=+ABS(RC[-1])"
Range("K" & lRow).Select
Range("A" & lRow).Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=+LEFT(RC[40],2)"
Range("A" & lRow).Select
Dim lRow2 As Long
'Find the last non-blank cell in column A(1)
lRow2 = Cells(Rows.Count, 10).End(xlUp).Row
Selection.AutoFill Destination:=Range("A" & lRow & ":A" & lRow2), Type:=xlFillDefault
'
' Dim lRow2 As Long
'
'
''Find the last non-blank cell in column A(1)
'lRow2 = Cells(Rows.Count, 10).End(xlUp).Row
'
''MsgBox "lRow: " & lRow & vbCrLf & _
'' "lRow2: " & lRow2 & vbCrLf & _
' "Selection: " & Selection.Address
Range("K" & lRow).Select
If lRow2 > lRow Then
Selection.AutoFill Destination:=Range("K" & lRow & ":K" & lRow2), Type:=xlFillDefault
End If
Sheets("CARS TO HQARS BUMP").Select
Range("D44:D70").Select
Selection.Copy
Sheets(ThisWorkbook.Worksheets("Variables").Range("A7").Value & " " & ThisWorkbook.Worksheets("Variables").Range("A14").Value & " IDARRS").Select
Range("AO" & lRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A" & lRow).Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=+LEFT(RC[40],2)"
Range("A" & lRow).Select
Selection.AutoFill Destination:=Range("A" & lRow & ":A" & lRow2), Type:=xlFillDefault
Range("B" & lRow).Select
ActiveCell.FormulaR1C1 = "TREAS VAR"
Range("B" & lRow).Select
Selection.AutoFill Destination:=Range("B" & lRow & ":B" & lRow2), Type:=xlFillDefault
Range("C" & lRow).Select
ActiveCell.FormulaR1C1 = ThisWorkbook.Worksheets("Variables").Range("A6").Value
Range("C" & lRow).Copy
Selection.AutoFill Destination:=Range("C" & lRow & ":C" & lRow2), Type:=xlFillDefault
Range("C" & lRow & ":C" & lRow2).Select
Range("C" & lRow & ":C" & lRow2).Select
Range("D" & lRow).Select
ActiveCell.FormulaR1C1 = "FFFF"
Range("D" & lRow).Copy
Selection.AutoFill Destination:=Range("D" & lRow & ":D" & lRow2)
Range("D" & lRow & ":D" & lRow2).Select
Range("E" & lRow).Select
ActiveCell.FormulaR1C1 = "=+MID(RC[36],4,4)"
Range("E" & lRow).Select
Selection.AutoFill Destination:=Range("E" & lRow & ":E" & lRow2), Type:=xlFillDefault
Range("E" & lRow & ":E" & lRow2).Select
Application.WindowState = xlNormal
Range("AF" & lRow).Select
Windows("Suspense automation.xlsm").Activate
Range("AF15").Select
Range(Selection, Selection.End(xlDown)).Select
Range("AF" & lRow).Select
Sheets("CARS TO HQARS BUMP").Select
Range("D51").Select
Selection.Copy
Sheets(ThisWorkbook.Worksheets("Variables").Range("A7").Value & " " & ThisWorkbook.Worksheets("Variables").Range("A14").Value & " IDARRS").Select
Range("E2592").Select
Rows("1:1").Select
With ActiveWindow
.SplitColumn = 0
.SplitRow = 1
End With
Application.WindowState = xlMaximized
ActiveWindow.FreezePanes = True
Range("L18").Select
Range(Selection, Selection.End(xlDown)).Select
Range("AF" & lRow).Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=+MID(RC[9],13,1)"
Range("AF" & lRow).Select
Selection.AutoFill Destination:=Range("AF" & lRow & ":AF" & lRow2), Type:=xlFillDefault
Range("AF" & lRow & ":AF" & lRow2).Select
Range("AF" & lRow).Select
ActiveCell.FormulaR1C1 = "=+IF(RIGHT(RC[9],3)=""TDD"","" "",MID(RC[9],13,1))"
Range("AF" & lRow).Select
Selection.AutoFill Destination:=Range("AF" & lRow & ":AF" & lRow2), Type:=xlFillDefault
Sheets("CARS TO HQARS BUMP").Select
Range("C44:C79").Select
Selection.Copy
Sheets(ThisWorkbook.Worksheets("Variables").Range("A7").Value & " " & ThisWorkbook.Worksheets("Variables").Range("A14").Value & " IDARRS").Select
Range("J" & lRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("CARS TO HQARS BUMP").Select
Range("D44:D79").Select
Application.CutCopyMode = False
Selection.Copy
Sheets(ThisWorkbook.Worksheets("Variables").Range("A7").Value & " " & ThisWorkbook.Worksheets("Variables").Range("A14").Value & " IDARRS").Select
Range("AO" & lRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AH" & lRow).Select
Sheets(ThisWorkbook.Worksheets("Variables").Range("A7").Value & " " & ThisWorkbook.Worksheets("Variables").Range("A14").Value & " IDARRS").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=+RIGHT(RC[7],9)"
Range("AH" & lRow).Select
ActiveCell.FormulaR1C1 = "=+RIGHT(RC[7],12)"
Range("AH" & lRow).Select
Selection.AutoFill Destination:=Range("AH" & lRow & ":AH" & lRow2), Type:=xlFillDefault
Range("AH" & lRow & ":AH" & lRow2).Select
Range("AH" & lRow).Select
ActiveCell.FormulaR1C1 = _
"=IF(RIGHT(RC[7],3)=""TDD"",RIGHT(RC[7],8),+RIGHT(RC[7],12))"
Range("AH" & lRow).Select
Selection.AutoFill Destination:=Range("AH" & lRow & ":AH" & lRow2)
Range("AH" & lRow & ":AH" & lRow2).Select
Range("AI" & lRow).Select
ActiveCell.FormulaR1C1 = "NO"
Range("AI" & lRow).Select
Selection.AutoFill Destination:=Range("AI" & lRow & ":AI" & lRow2)
Range("AI" & lRow & ":AI" & lRow2).Select
Range("AJ" & lRow).Select
ActiveCell.FormulaR1C1 = "COMPLETE"
Range("AJ" & lRow).Select
Selection.AutoFill Destination:=Range("AJ" & lRow & ":AJ" & lRow2)
Range("AJ" & lRow & ":AJ" & lRow2).Select
Range("AK" & lRow).Select
ActiveCell.FormulaR1C1 = "=+RC[-27]"
Range("AK" & lRow).Copy
Selection.AutoFill Destination:=Range("AK" & lRow & ":Ak" & lRow2)
Range("Ak" & lRow & ":Ak" & lRow2).Select
Range("AL" & lRow).Select
ActiveCell.FormulaR1C1 = "Supplemental JVs"
Range("AI" & lRow).Select
Range("AL" & lRow).Select
Selection.AutoFill Destination:=Range("AL" & lRow & ":AL" & lRow2)
Range("AL" & lRow & ":AL" & lRow2).Select
Range("AR" & lRow).Select
ActiveCell.FormulaR1C1 = "=+CONCATENATE(RC[-43],""-"",RC[-1],""-"",RC[-10])"
Range("AR" & lRow).Copy
Selection.AutoFill Destination:=Range("AR" & lRow & ":AR" & lRow2)
Range("AR" & lRow & ":Ak" & lRow2).Select
Range("AQ" & lRow).Select
Range("AP" & lRow).Select
Range("AQ" & lRow).Select
ActiveWindow.ScrollColumn = 36
Range("AO" & lRow).Select
Range("AQ" & lRow).Select
ActiveCell.FormulaR1C1 = "=+MID(RC[-2],4,8)"
Range("AQ" & lRow).Select
Selection.AutoFill Destination:=Range("AQ" & lRow & ":AQ" & lRow2)
Range("AQ" & lRow & ":AQ" & lRow2).Select
End Sub