79091642

Date: 2024-10-15 20:33:40
Score: 0.5
Natty:
Report link

Here is the code prior to and including that shown in the question. The remainder of the code is comprised of many iterations of attempted copy-paste from TxtBk to TmpBk.

    Dim wbk as Workbook
    Dim TxtBk as Workbook
    Dim TmpBk as Workbook                                                                     

    Set wbk = ThisWorkbook
    Set TxtBk = ActiveWorkbook
    
'   Get path from worksheet
    fromPath = wbk.Sheets("Instructions").Range("A20").Value
    
'   Make sure there is a backslash at the end of the from path
    If Right(fromPath, 1) <> "\" Then fromPath = fromPath & "\"

'   Open new file based on template
    Set TmpBk = Workbooks.Add(fromPath & "UST37.xltx")

'   Move data from parsed file to template

'   Sheet OAA
'   Running Date
    TxtBk.Sheets("OAA").Activate
    Range("D4").Copy
    TmpBk.Sheets("OAA").Activate
    Range("G4").PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False `
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Thom B