hi all,
i am facing a problem. i have a master sheet and some working sheets in the same workbook. in the master sheet there are 3 column heads. T1, T2 and T3.
the working sheets could be either T1, T2 or T3. If working sheet is T1, range E14:F88 of the working sheet has to be copied to the master sheet under the column head T1 and if the working sheet is T2, that range to be copied under the column head T2 and same for T3.
i have written the code but its not working. in the working sheets T1, T2 or T3 is written on cell B8. worksheet(1) is the master sheet while worksheet(2) is the working sheet.
Sub addvalues()
For p = 7 To 9
If Worksheets(1).Cells(9, p) = Worksheets(2).Cells(8, 2) Then
m = p
End If
Next p
For y = 14 To 88
For Z = 5 To 6
Worksheets(1).Cells(Z, y) = Worksheets(2).Cells(Z, y)
Worksheets(1).Cells(Z, m) = Worksheets(2).Cells(Z, m)
Next Z
Next y
End Sub
thanks.
Prajesh
Bookmarks