Copy Macro

tintin1012000

Board Regular
Joined
Apr 27, 2011
Messages
237
Below macro is copy of one from a different workbook, It works fine on the other work book but it wont work in a new one


Any ideas ?

Sub Macro1()

Dim weekno As Integer
Dim wbname As String

weekno = Sheet1.Range("B25").Value
wbname = "wk" & weekno

Sheet1.Range("D55").Value = "='\\IEMAFS001\VOL1\APM\Prodqty\Electronic shift book\8882\Line 1\[" & wbname & ".xls]Graphs'!$Q$47"



End Sub
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
New workbook
Does it have
a value in B25

does the file and sheet \\IEMAFS001\VOL1\APM\Prodqty\Electronic shift book\8882\Line 1\[" & wbname & ".xls]Graphs' Exist ?

is D55 protected?
 
Upvote 0
Does it have
a value in B25,
B25 is where i put in a week number, for example, if i put 40 B25 then the link should be \\IEMAFS001\VOL1\APM\Prodqty\Electronic shift book\8882\Line 1\[40.xls]Graphs'


does the file and sheet \\IEMAFS001\VOL1\APM\Prodqty\Electronic shift book\8882\Line 1\[" & wbname & ".xls]Graphs' Exist ?
Yes this file exists

is D55 protected? no its not protected
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,894
Members
452,948
Latest member
Dupuhini

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