1

I am running a code using VBA. It starts by looping through a directory and pulling the files.

My goal is to copy a range and paste it to a template worksheet.

The copy code looks like such:

Dim StrFile As Variant
For Each StrFile In var

Workbooks.Open (loc1 & StrFile)

    sh.Activate
    On Error Resume Next
    Set uBOM = Cells.Find(What:="No.", After:=[A1], LookIn:=xlFormulas, _
    LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False)
    Range(Cells(uCost.Row + 1, uCost.Column), Cells(uCost.Row.End(xlDown), uCost.Columnn + 4)).Copy
    On Error GoTo 0

Next StrFile

How can I modify this or use to paste this into the template workbook (which I will be running the code from)?

Regards, Marc

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.