Dim MyLastRow As Long, x As Long, y As Long, w As Long, z As Long ' Set Variables
Dim sWBU As Worksheet, sWBUT As Worksheet ' Set worksheet abbreviations
Dim varConctnt As Variant
Sheets.Add.Name = "Forecast" ' Add new sheet called "FORCAST"
Set sWBU = Worksheets("2014") ' Name of worksheets for data source
Set sWBUT = Worksheets("Forecast") ' Name of worksheets for data destination
MyLastRow = sWBU.UsedRange.Rows.Count ' Find Final Row in dataset
varConctnt = "FR-25-UK-" ' Used to concatenate text cell value
x = 2 ' Start row to copy to
w = 1 ' Start Column to copy to
z = 9 ' Start column to copy from
For y = 30 To mylastrow ' first row of the source data
If Not IsEmpty(sWBU.Cells(y, 9)) Then
sWBUT.Cells(x, w).Value = varConctnt & sWBU.Cells(y, z).Value & "-URF" ' This concatenate the AA & nominal code
sWBUT.Cells(x, 3).Value = sWBU.Cells(y, 11).Value ' Project
sWBUT.Cells(x, 2).Value = sWBU.Cells(y, 13).Value ' Source
sWBUT.Cells(x, 4).Value = sWBU.Cells(y, 42).Value ' Jan of first year
sWBUT.Cells(x, 5).Value = sWBU.Cells(y, 47).Value ' Feb of first year
sWBUT.Cells(x, 6).Value = sWBU.Cells(y, 52).Value ' Mar of first year
sWBUT.Cells(x, 7).Value = sWBU.Cells(y, 57).Value ' Apr of first year
sWBUT.Cells(x, 8).Value = sWBU.Cells(y, 62).Value ' May of first year
sWBUT.Cells(x, 9).Value = sWBU.Cells(y, 67).Value ' Jun of first year
sWBUT.Cells(x, 10).Value = sWBU.Cells(y, 72).Value ' Jul of first year
sWBUT.Cells(x, 11).Value = sWBU.Cells(y, 77).Value ' Aug of first year
sWBUT.Cells(x, 12).Value = sWBU.Cells(y, 82).Value ' Sep of first year
sWBUT.Cells(x, 13).Value = sWBU.Cells(y, 87).Value ' Oct of first year
sWBUT.Cells(x, 14).Value = sWBU.Cells(y, 92).Value ' Nov of first year
sWBUT.Cells(x, 15).Value = sWBU.Cells(y, 97).Value ' Dec of first year
sWBUT.Cells(x, 16).Value = sWBU.Cells(y, 102).Value ' Jan of 2nd year
sWBUT.Cells(x, 17).Value = sWBU.Cells(y, 107).Value ' Feb of 2nd year
sWBUT.Cells(x, 18).Value = sWBU.Cells(y, 112).Value ' Mar of 2nd year
sWBUT.Cells(x, 19).Value = sWBU.Cells(y, 117).Value ' Apr of 2nd year
sWBUT.Cells(x, 20).Value = sWBU.Cells(y, 122).Value ' May of 2nd year
sWBUT.Cells(x, 21).Value = sWBU.Cells(y, 127).Value ' Jun of 2nd year
sWBUT.Cells(x, 22).Value = sWBU.Cells(y, 132).Value ' Jul of 2nd year
sWBUT.Cells(x, 23).Value = sWBU.Cells(y, 137).Value ' Aug of 2nd year
sWBUT.Cells(x, 24).Value = sWBU.Cells(y, 142).Value ' Sep of 2nd year
sWBUT.Cells(x, 25).Value = sWBU.Cells(y, 147).Value ' Oct of 2nd year
sWBUT.Cells(x, 26).Value = sWBU.Cells(y, 152).Value ' Nov of 2nd year
sWBUT.Cells(x, 27).Value = sWBU.Cells(y, 157).Value ' Dec of 2nd year
x = x + 1
z = 9
w = 1
End If
Next y
varConctnt = ""
Bookmarks