Dear All,
I hope this wonderful forum could help please. I gain alot of experience and knowledge from people on here so firstly a thank you for that.
I've looked on the forum but am unable to find the answer the to query below (I may not be wording it correctly).
The code I'm trying to write is basically a cycle code that creates standard links to another file that is named in the macro - like so.
Any and all help would be greatly appreciated.
Thank you in advance
GG452
I hope this wonderful forum could help please. I gain alot of experience and knowledge from people on here so firstly a thank you for that.
I've looked on the forum but am unable to find the answer the to query below (I may not be wording it correctly).
The code I'm trying to write is basically a cycle code that creates standard links to another file that is named in the macro - like so.
Code:
Sub LoopThroughSheets()
'Set the results file
Dim rwb As Workbook
Set rwb = Workbooks("Actuals.xlsx")
'Set the reference (current) workbook
Dim PMWB As Workbook
Set PMWB = Workbooks("Forecast.xlsm")
'Set the column of the file - plus 1 each month
Dim mycolumn As Integer
mycolumn = 5
Dim Sheets As Variant
Dim Sheet As Variant
Sheets = Array("S1", "S2", "S3")
For Each Sheet In Sheets
'This needs to change per sheet
Dim myrow As Integer
myrow = 30
Cells(30, mycolumn).Select
ActiveCell.Formula = "='[" & rwb & "]Actual'!C" & myrow
Cells(64, mycolumn).Select
ActiveCell.Formula = "='[" & rwb & "]Actual'!C" & myrow
Cells(113, mycolumn).Select
ActiveCell.Formula = "='[" & rwb & "]Actual'!C" & myrow
Next Sheet
End Sub
Any and all help would be greatly appreciated.
Thank you in advance
GG452