justmeok
New Member
- Joined
- Jul 27, 2011
- Messages
- 42
- Office Version
-
- 365
- Platform
-
- Windows
Hi All 
I have a simple macro that copies a worksheet to a new workbook and saves it to a different location. When I use this macro to copy a table that was generated by a power query within the workbook to a new workbook it also copies the query. I have no idea how to amend the macro to just copy the table and not the query as well. Is this even possible?
I would very much appreciate some help
I have a simple macro that copies a worksheet to a new workbook and saves it to a different location. When I use this macro to copy a table that was generated by a power query within the workbook to a new workbook it also copies the query. I have no idea how to amend the macro to just copy the table and not the query as well. Is this even possible?
Code:
Sub Save_ActiveSheet_As_New_Workbook()
'save worksheet to new workbook in specified folder with same name as worksheet
ActiveSheet.Copy
Application.DisplayAlerts = False
With ActiveWorkbook
.SaveAs "E:\Accounts\Current Tables\" & .Sheets(1).Name
Application.DisplayAlerts = True
.Close 0
End With
I would very much appreciate some help