Sub Building_Concrete()
Dim ws As Worksheet, ws1 As Worksheet
Dim lastrow As Long
Dim totalrow As Long
Dim lc As Range
Set ws = Worksheets("OSTcopy")
Set ws1 = Worksheets("BUILDING CONC")
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
' Initialize to start at bottom of column O
totalrow = ws1.Cells(Rows.Count, "IL").End(xlUp).Row
' last row in column F
lastrow = ws.Cells(Rows.Count, 6).End(xlUp).Row
' Copy the formatted OST Report and insert into Template
ws.Rows("11:" & lastrow).Copy
ws1.Activate
ws1.Rows("19:19").Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
' Make sure the OST formulas are pasted values
ws.Rows("11:" & lastrow).Copy
ws1.Activate
ws1.Rows("19:19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ws1.Activate
' Loop through rows
Do
' Exit if at row 10
If totalrow = 19 Then Exit Do
' Copy formula from example row
If Range("F", totalrow).Value <> "" Then
ws1.Range("N16:IL16").Copy
ws1.Range("N19:IL" & totalrow).PasteSpecial xlPasteAll
End If
Loop
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Everything above the bolded red colored section is working. What I'm trying to do is copy formulas from row 16 to every row that has any data in column "F", from the "Total" row. The total row varies based on the size of the report that's being inserted from another tab. I made sure to copy over the entire sub, in case I've got something wrongly defined for the totalrow. Any help would be greatly appreciated.
Dim ws As Worksheet, ws1 As Worksheet
Dim lastrow As Long
Dim totalrow As Long
Dim lc As Range
Set ws = Worksheets("OSTcopy")
Set ws1 = Worksheets("BUILDING CONC")
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
' Initialize to start at bottom of column O
totalrow = ws1.Cells(Rows.Count, "IL").End(xlUp).Row
' last row in column F
lastrow = ws.Cells(Rows.Count, 6).End(xlUp).Row
' Copy the formatted OST Report and insert into Template
ws.Rows("11:" & lastrow).Copy
ws1.Activate
ws1.Rows("19:19").Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
' Make sure the OST formulas are pasted values
ws.Rows("11:" & lastrow).Copy
ws1.Activate
ws1.Rows("19:19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ws1.Activate
' Loop through rows
Do
' Exit if at row 10
If totalrow = 19 Then Exit Do
' Copy formula from example row
If Range("F", totalrow).Value <> "" Then
ws1.Range("N16:IL16").Copy
ws1.Range("N19:IL" & totalrow).PasteSpecial xlPasteAll
End If
Loop
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Everything above the bolded red colored section is working. What I'm trying to do is copy formulas from row 16 to every row that has any data in column "F", from the "Total" row. The total row varies based on the size of the report that's being inserted from another tab. I made sure to copy over the entire sub, in case I've got something wrongly defined for the totalrow. Any help would be greatly appreciated.