I have program like this
[code/]
Public Function aUnit(Element As Integer)
aUnit = Array("AA", "AB", "AC")(Element)
End Function
Private Sub Refresh_Click()
For nLoop = 0 To nMaxUnit
cUnit = aUnit(nLoop)
For nCol = 21 To 25
For nRow = 8 To nMaxRow
Sheets(cUnit).Cells(nRow, nCol).FormulaR1C1 = _
"='[MON2005.xls]cUnit'!Cells(nRow, nCol)"
Next
Next
Next
End Sub
[/code]
There is an error at
"='[MON2005.xls]cUnit'!Cells(nRow, nCol)"
how to correct this error ?
Thank In Advice.
[code/]
Public Function aUnit(Element As Integer)
aUnit = Array("AA", "AB", "AC")(Element)
End Function
Private Sub Refresh_Click()
For nLoop = 0 To nMaxUnit
cUnit = aUnit(nLoop)
For nCol = 21 To 25
For nRow = 8 To nMaxRow
Sheets(cUnit).Cells(nRow, nCol).FormulaR1C1 = _
"='[MON2005.xls]cUnit'!Cells(nRow, nCol)"
Next
Next
Next
End Sub
[/code]
There is an error at
"='[MON2005.xls]cUnit'!Cells(nRow, nCol)"
how to correct this error ?
Thank In Advice.