Hello,
I am stuck with the following. Any help on the same would be much appreciated.
'''''''''''''''''''''''''''''''''''''''
I want to add cell B1 in all the worksheets of a workbook and put it in cell B1 of the summary sheet. I want to do it for all the sheets in the worksheet staring with name Satish. I want to repeat the above activity for each cell in the range B1 to D5 in the sheet summary. The follwing code doesn't work. Please help me fix it up.
........................
Sub consolidate()
Dim j As Long, k As Long, tot As Double
Dim c As Range
For Each c In Worksheets("master").Range("B1:D5")
j = Worksheets.Count
tot = 0
For k = 1 To j
If Worksheets(k).Name <> "master" Then
If LCase(Left(Worksheets(k).Name, 5)) = "satish" Then
tot = tot + Worksheets(k).c.Cells(1).Value
End If
End If
Next k
Worksheets("master").c = tot
Next c
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Thanking you for your sugggestions in advance.
Bookmarks