Quote Originally Posted by Rick Rothstein View Post
You can shorten the above code to this...

Code:
Sub ExcelFox()
  Dim wks As Worksheet
  For Each wks In ThisWorkbook.Worksheets
    If wks.Name Like "*[PS]" Then wks.Range("G9:J" & wks.Cells(Rows.Count, "A").End( _
           xlUp).Row) = Array(Abs(wks.Name Like "*P"), "Minutes", -4431, #1/1/2013#)
  Next
End Sub
Note: I wrapped the long line of code using the line continuation character for neatness of display, but you can unwrap that line if you want.

Hi Rick Rothstein

I am having problem here ["G9:J" & wks.Cells(Rows.Count, "A")], I was just trying to do it for my practice but it is not giving me results, can you elaborate please?