hello i have the following macro that changes the changes one of the references in the cells...
Sub CreateFormulas()
Dim ws As Worksheet
Dim MainPath As String
Dim CityBk As String
Dim Rw As Long
Application.DisplayAlerts = False
MainPath = "='C:\Documents and Settings\Archieve 2011\"
For Each ws In Worksheets
If ws.Range("C5") = "Period" Then
CityBk = "\[" & ws.Name & ".xls]G.S Branch'!"
For Rw = 7 To 1119 Step 21
Range("C" & Rw + 1, "M" & Rw + 20).Formula = MainPath & Range("C" & Rw) & CityBk & "C" & Rw - 2
Range("N" & Rw + 1, "Y" & Rw + 20).Formula = MainPath & Range("C" & Rw) & CityBk & "O" & Rw - 2
Next Rw
End If
Next ws
End Sub
i have attached a sample workbook, if you notice, each range in columns (E:Y) uses P1W1, P1W2...P12W5 to derive the end result....and at the end the cell reference is an abolute value.
when i run the above macro, although it does what i want by inserting the correct period/week i.e. P1W1 ..or P2W1 in its corresponding column, it doesnt however keep the i.e. $E$8 or $Y$28 or $H$45 etc absolute, it makes it relative and thus drags the formula down.......so can anyone help pls its been realy hampering the whole file...i have 33 more worksheets to add an this macro does it rvery quick, just changes the references. thx you, happy holidays
Bookmarks