Good Day All!!
I need little help in fetching the count value available in each sheet to the Index Sheet.
The workbook contains:
1. Index Sheet
2. Sheet-1, Sheet-2, Sheet-3 ....etc
3. Each sheet has the count of parameters in Column-N and Cell-N1
4. Index has the list of Sheet Names, Sheet Description and No of Parameters
Solution required:
a. Go to Sheet(i)
b. Copy Sheet(i).N1
c. In Index Sheet
x) search for Sheet(i).row
x) Paste Sheet(i).N1 to its respective count of parameters in Index Sheet
Sub Macro1()
Dim LR As Long
Dim S As Worksheet
For Each S In Worksheets
With S
LR = .Cells(Rows.Count, 2).End(xlUp).Row
'Flag rows to be copied
.Range("N2:N" & LR).FormulaR1C1 = _
"=IF(AND(ISNUMBER(LEFT(RC[-12],2)*1),RIGHT(RC[-12],2)<>""-L"",RIGHT(RC[-12],2)<>""-A"",RIGHT(RC[-12],6)<>""-GROUP""),1,"""")"
.Range("N2:N" & LR).Value = .Range("N2:N" & LR).Value
'Count the rows to be copied in N1 of each sheet
For i = 1 To Sheets.Count
If Sheets(i).Name = "Index" Then GoTo zz
x = Range("N" & Rows.Count).End(xlUp).Row
Sheets(i).Range("N1") = Application.WorksheetFunction.Countif(Sheets(i).Range("N2:N500" & x), "1")
zz:
Next i
'Copy the count available in Column N1 of each sheet to its respective row in Index Sheet - Column D
"Help Required here"
End With
Next
Kind Regards,
Sreeks
Bookmarks