C
caroline
Hi again,
in fact my question was slightly more complicated. I am not sure how to
adapt the "cells" function to my problem.
tHANKS IN ADVANCE
this is my code:
Application.ScreenUpdating = False
Dim i%
Dim x As Range
Dim asRangeNames(1 To 10)
asRangeNames(1) = "Country1"
asRangeNames(2) = "Country2"
asRangeNames(3) = "Country3"
asRangeNames(4) = "Country4"
asRangeNames(5) = "Country5"
asRangeNames(6) = "Country6"
asRangeNames(7) = "Country7"
asRangeNames(8) = "Country8"
asRangeNames(9) = "Country9"
asRangeNames(10) = "Country10"
Dim y As Range
Dim asRangeNamesD(1 To 10)
asRangeNamesD(1) = "importCheck1"
asRangeNamesD(2) = "importCheck2"
asRangeNamesD(3) = "importCheck3"
asRangeNamesD(4) = "importCheck4"
asRangeNamesD(5) = "importCheck5"
asRangeNamesD(6) = "importCheck6"
asRangeNamesD(7) = "importCheck7"
asRangeNamesD(8) = "importCheck8"
asRangeNamesD(9) = "importCheck9"
asRangeNamesD(10) = "importCheck10"
Dim W As Range
Dim asRangeNamesW(1 To 10)
asRangeNamesW(1) = "workbook1name"
asRangeNamesW(2) = "workbook2name"
asRangeNamesW(3) = "workbook3name"
asRangeNamesW(4) = "workbook4name"
asRangeNamesW(5) = "workbook5name"
asRangeNamesW(6) = "workbook6name"
asRangeNamesW(7) = "workbook7name"
asRangeNamesW(8) = "workbook8name"
asRangeNamesW(9) = "workbook9name"
asRangeNamesW(10) = "workbook10name"
'PROCEDURE
For i = 1 To UBound(asRangeNames)
Set x = Worksheets("Sales Data").Range(asRangeNames(i))
Set y = Range(asRangeNamesD(i))
Set W = Range(asRangeNamesW(i))
'THIS IS THE PART I AM NOT TOO SURE ABOUT
x.Offset(100, 2) = y.Value *
Workbooks(W.Value).Worksheets("Forecast").Range("a10:b110")
End If
Next i
in fact my question was slightly more complicated. I am not sure how to
adapt the "cells" function to my problem.
tHANKS IN ADVANCE
this is my code:
Application.ScreenUpdating = False
Dim i%
Dim x As Range
Dim asRangeNames(1 To 10)
asRangeNames(1) = "Country1"
asRangeNames(2) = "Country2"
asRangeNames(3) = "Country3"
asRangeNames(4) = "Country4"
asRangeNames(5) = "Country5"
asRangeNames(6) = "Country6"
asRangeNames(7) = "Country7"
asRangeNames(8) = "Country8"
asRangeNames(9) = "Country9"
asRangeNames(10) = "Country10"
Dim y As Range
Dim asRangeNamesD(1 To 10)
asRangeNamesD(1) = "importCheck1"
asRangeNamesD(2) = "importCheck2"
asRangeNamesD(3) = "importCheck3"
asRangeNamesD(4) = "importCheck4"
asRangeNamesD(5) = "importCheck5"
asRangeNamesD(6) = "importCheck6"
asRangeNamesD(7) = "importCheck7"
asRangeNamesD(8) = "importCheck8"
asRangeNamesD(9) = "importCheck9"
asRangeNamesD(10) = "importCheck10"
Dim W As Range
Dim asRangeNamesW(1 To 10)
asRangeNamesW(1) = "workbook1name"
asRangeNamesW(2) = "workbook2name"
asRangeNamesW(3) = "workbook3name"
asRangeNamesW(4) = "workbook4name"
asRangeNamesW(5) = "workbook5name"
asRangeNamesW(6) = "workbook6name"
asRangeNamesW(7) = "workbook7name"
asRangeNamesW(8) = "workbook8name"
asRangeNamesW(9) = "workbook9name"
asRangeNamesW(10) = "workbook10name"
'PROCEDURE
For i = 1 To UBound(asRangeNames)
Set x = Worksheets("Sales Data").Range(asRangeNames(i))
Set y = Range(asRangeNamesD(i))
Set W = Range(asRangeNamesW(i))
'THIS IS THE PART I AM NOT TOO SURE ABOUT
x.Offset(100, 2) = y.Value *
Workbooks(W.Value).Worksheets("Forecast").Range("a10:b110")
End If
Next i