Copy sheet from Workbook 1 and move to the end Workbook 2

IAP

New Member
Joined
Aug 6, 2020
Messages
8
Office Version
  1. 2010
Platform
  1. Windows
I have Tried using almost every code on the internet and just tried MrExcels code below, and I just keep getting errors.
Sub CopySheetToNewPage ()
Workbooks.Open Filename:="C:\Users\jfjen\Desktop\New Mold Program\AAA Master File\Location Forms.xlsm"
Sheets("Location 2").Copy After:=Workbooks("A12.Basic Reports.xlsm").Sheets(Sheets.Count)
ActiveSheet.Name = "Location 2"
Workbooks("A12.Basic Reports.xlsm").Close savechanges:=False
End Sub

Workbook name - Location Forms.xlsm has a sheet named Location 2.
I want to copy and Paste sheet named Location 2 into Workbook named A12.Basic Reports.xlsm
After a sheet named Location 1
 

IAP

New Member
Joined
Aug 6, 2020
Messages
8
Office Version
  1. 2010
Platform
  1. Windows
Tried every way and combination. Either Line goes Red or back to Yellow.
Same thats happened for days.
Thank You for helping so long, but I think its time to give up on the idea that this will work and I will have to try to rethink my program.
It seems like it should be so simple, buts its very hard for the person that is a novice.
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,231
Office Version
  1. 365
Platform
  1. Windows
If you open the Location Forms file & select the Location 1 sheet, then run this
VBA Code:
Sub Check()
   MsgBox "|" & ActiveSheet.Name & "|" & vbLf & Len(ActiveSheet.Name)
End Sub
What exactly doe the message box say?
 

IAP

New Member
Joined
Aug 6, 2020
Messages
8
Office Version
  1. 2010
Platform
  1. Windows
I gave up on that code.
I found another when I was closing out on another site just as I was giving up.
I plugged in the same information and it ran the first time.
Thanks to everyone that was helping me.
 

Watch MrExcel Video

Forum statistics

Threads
1,126,957
Messages
5,621,827
Members
415,859
Latest member
Vain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top