Summary

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

After my first post in Worksheet Functions, and this being my first post ever, I eralized I probably should have posted here. Im not trying to cross post just trying to do it the right way. You guys are great for the vast knowledge you share
Heres the scnario...
I am trying to create a summary page as follows....The pages to be summarized vary from day to day, but are located between two sheets, that are always there. The cells to be brought over to the summary are P11:P38. The qualifier to summarize or not is found in P13. If the second character of P13 is an "F" or "Red" then copy P11:P38 to the summary page. (there are actually 6 different possibilities for P13 with 5 of them having F as the second character). I hope this post wasnt too confusing

Thank
Tro

Thanks
Tro
 
Troy,

Try the sub below: the two sheets that are alway there are assumed to not
have data, and have the names First Sheet and Last Sheet.

HTH,
Bernie
MS Excel MVP

Sub TryNow()
Dim i As Integer
Dim myVal As String

On Error Resume Next
Application.DisplayAlerts = False
Worksheets("Summary").Delete
Application.DisplayAlerts = True

Worksheets.Add(Worksheets(1)).Name = "Summary"

For i = Worksheets("First Sheet").Index + 1 To Worksheets("Last
Sheet").Index - 1
myVal = Worksheets(i).Range("P13").Text
If UCase(Mid(myVal, 2, 1)) = "F" Or myVal = "Red" Then
Worksheets(i).Range("P11:P38").Copy _
Worksheets("Summary").Range("IV1").End(xlToLeft)(1, 2)
End If
Next i

End Sub

Troy said:
After my first post in Worksheet Functions, and this being my first post
ever, I eralized I probably should have posted here. Im not trying to cross
post just trying to do it the right way. You guys are great for the vast
knowledge you share.
Heres the scnario....
I am trying to create a summary page as follows....The pages to be
summarized vary from day to day, but are located between two sheets, that
are always there. The cells to be brought over to the summary are P11:P38.
The qualifier to summarize or not is found in P13. If the second character
of P13 is an "F" or "Red" then copy P11:P38 to the summary page. (there are
actually 6 different possibilities for P13 with 5 of them having F as the
second character). I hope this post wasnt too confusing.
 
Back
Top