Excel Macro Errors!

smitmika99

New Member
Joined
Jul 5, 2018
Messages
2
I have a master workbook called Paterson Bulk Service Records and then individual sheets in folders for each of the Master workbook sheets to link over (i've done it before for something else and I had no trouble but now i do)

The bold line is the one that has a Subscript Error and changes the individual sheet to 1(2) and it's just a pain! Someone please help me!

Sub wscopy()



Dim PatersonBulkServiceRecords, fleet1 As Workbook, ws11 As Worksheet

Set PatersonBulkServiceRecords = ThisWorkbook
Set fleet1 = Workbooks.Open("E:\Paterson Bulk Service Records.xlsx")
Set ws11 = PatersonBulkServiceRecords.Sheets("1")
Set ws21 = fleet1.Sheets("1")



ws21.Copy before:=ws11
fleet1.Close


Application.DisplayAlerts = False
ws11.Delete
Application.DisplayAlerts = True


PatersonBulkServiceRecords.Sheets("1(2)").Name = "1"
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi & welcome to MrExcel
You need a space in the sheet name
Code:
PatersonBulkServiceRecords.Sheets("1 (2)").name = "1"
 
Last edited:
Upvote 0
Not for me it doesn't. Have you made any other changes to the code you've posted?
 
Upvote 0

Forum statistics

Threads
1,223,970
Messages
6,175,703
Members
452,667
Latest member
vanessavalentino83

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
Back
Top