View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
scattered[_4_] scattered[_4_] is offline
external usenet poster
 
Posts: 18
Default I figured it out!

On Sep 22, 9:53*am, KingdomGirl
wrote:
Okay, disregard the previous post. *I figured out my mistake. *It had been so
long, I forgot that I had to change the sheet name in the macro each time I
ran the macro. *Duh!

It's fun to be able to figure things out, but if I understand you then
it sounds like you are doing too much work if you need to modify the
code 19 times in order to do what you want to do. Perhaps you could
replace the section of code

With Sheets("WK")
(...)
End With

by

For Each ws In Sheets
If ws.Name < Sheets("Criteria").Name Then
With ws
(...)
End With
End If
Next ws


(here ws is of course a declared worksheet variable and (...) is the
body of the with statement)

hth

-scattered