copy temp worksheet to current workbook

35 Views Asked by At

I have a dedicated workbook named POOM C REPORT. I have about 22 tabs and each tab has a certain report on it. Basically I will have my POOM C REPORT open then open the temp worksheet. I would hit my macro button and it would copy the temp sheet and paste it into the NA tab then it would close the temp sheet leaving only the POOM C REPORT open. For instance this tab open in POOM C REPORT is called NA. This was the macro I have that I would edit depending on the tab. The Call macros are separate macros I created due to the way I had to filter and arrange the temp worksheet before it would be pasted into my NA tab. My issue my file was corrupted by someone who edited it in share point. Any time I run the macro I get run time error 9 subscript out of range. The error shows on the line that says Windows("POOM C REPORT").Activate. This type of macro is used on all 22 tabs but worded differently depending on what is needed. Is there another macro that someone has that can do the same thing. Everything I have found for examples shows how to add it to a new workbook or before/after on a workbook. Thank you all this report I use for work and it is sent out to over 500 people.

Sub ExportFromNA3()
'
' ExportFromNA3 Macro
'

'
Dim answer As VbMsgBoxResult
        
        answer = MsgBox("Are these the ONLY two Excel Workbooks presently open?", vbYesNo, "WARNING!")
        
        If answer = vbNo Then
        
        MsgBox "Well then open them..."
        
        End If
        
        If answer = vbYes Then

    ActiveWindow.WindowState = xlMinimized
    Call COPYNAUNDELIVERABLE
   
    Selection.Copy
    Windows("POOM C REPORT").Activate
    ActiveWindow.WindowState = xlMaximized
    Sheets("NA").Cells(Rows.Count, "A").End(xlUp).Offset(1). _
    PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
    SkipBlanks:=False
    Application.CutCopyMode = False
    ActiveWindow.WindowState = xlMinimized
    Application.DisplayAlerts = False
    ActiveWindow.Close SaveChanges:=False
    Windows("POOM C REPORT").Activate
    ActiveWindow.WindowState = xlMaximized
    
  
    
    End If
    
    Windows("POOM C REPORT").Activate
    ActiveWindow.WindowState = xlMaximized
    Call GETDATANEWNAREPORT
    Call OUTLINENACCESS
End Sub

Have tried editing the workbook title then changing the macros but still does not work

0

There are 0 best solutions below