Hi
I have a workbook that has 20 sheets.
I need to count the number of 2 in column A of the last 5 sheets.
Bearing in mind that whenever i run the macro the page name may change.
here is what i have to do before counting the number of 2's in column A:
If Sheets.Count > 4 Then
For i = Sheets.Count - 4 To Sheets.Count
If Not flg Then
Sheets(i).Select
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Range("A2").Select
ActiveCell.FormulaR1C1 = _
"=IF(AND(ISERROR(RC[2]),RC[1]<>""""),1,IF(AND(ISERROR(RC[2]),RC[1]=""""),2,""""))"
Else
Sheets(i).Select False
End If
Next
End If
so can any1 help?
thank you very much. You rhelp is much appreciated.
Bookmarks