This is my full code
Essentially, I'm pulling in data and inserting it. Then I need to copy the format down from the top row to the bottom row. Cannot get it to work correctly.
Any help at all please
VBA Code:
Sub StripData()
Call InsertData
Call FormatData
'Call DragData
End Sub
Sub InsertData()
Dim myWb As Workbook
Dim myRowsToCopy As Range
Set wbtemplate = Workbooks("Template.xlsm").Worksheets("Raw")
Set formatrange = Range("B2:CE2")
Set formularange = Range("AK2:CE2")
Set myWb = Workbooks.Open("C:\Users\me\Desktop\Practice\Data_Pull_Dummy.xlsx")
With myWb.Sheets("Data").Range("A:XFD")
Set myRowsToCopy = Range(.Cells(.Rows.Count, 1).End(xlUp), .Cells(2, .Columns.Count))
End With
myRowsToCopy.Copy
wbtemplate.Range("3:3").Insert Shift:=xlDown
Application.CutCopyMode = False
End Sub
Sub FormatData()
Dim wbtemplate As Workbook
Set template = Workbooks("Template.xlsm").Worksheets("Raw")
template.Range("B2:CE2").Copy Destination:=Sheets("Raw").Range("B" & Rows.Count).End(xlUp).Offset(-7)
End Sub
Essentially, I'm pulling in data and inserting it. Then I need to copy the format down from the top row to the bottom row. Cannot get it to work correctly.
Any help at all please