Dynamic linkage between workbooks

whatitdo

New Member
Joined
Jul 24, 2019
Messages
4
I use this code to transfer my data from one workbook toanother:


Windows("IK-periode26.xlsm").Activate
Sheets("Result").Select
Range("B6:G6").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Arbejdsfil v2 - IKS(TESTER).xlsm").Activate
Sheets("Result").Select
Range("C4").Select
Selection.PasteSpecial Paste:=xlPasteValues,Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False


What I need is theIK-periode 26 referencing/linking to be dynamic if possible… usually the nextfile have a similiar name (the number in the end usually change as itrepresents week number)

Is it possible to make a linking in the workbook (arbejdsfil v2) to the new workbook filefrom the desktop and then reference the cell with the link or something? Or perhaps make an inputbox which edit the specific string of text in the code thus fitting the name of the new workbook? other options are welcome :)

 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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