hi Geff,

I have made few changes in the macro. Try this updated one see if it helps

Sub new_macros()
Dim wk As Worksheet
Dim shtnms
Dim i As Integer

Application.DisplayAlerts = False
shtnms = Array("T1 < 30", "T1 > 30", "T2 < 30", "T2 > 30", "TC", "TM", "TJ")

'del exisitng sheets except sheet1
For Each wk In ThisWorkbook.Sheets
    If UCase(wk.Name) <> UCase("Sheet1") Then
        wk.Delete
    End If
Next



For i = LBound(shtnms) To UBound(shtnms)
    Sheets.Add(after:=Sheets(Sheets.Count)).Name = shtnms(i)
    Sheets("sheet1").Range("a1:z1").Copy
Destination:=ActiveSheet.Range("a1")
Next

' taken p assuming donation date will not be blank
For i = 2 To Sheets("sheet1").Range("p65356").End(xlUp).Row
    Select Case UCase(Sheets("sheet1").Range("x" & i).Value)

    Case "TC"
    Sheets("sheet1").Range("a" & i & ":z" & i).Copy
Destination:=Sheets("TC").Range("a" &
Sheets("TC").Range("p65356").End(xlUp).Row + 1)

    Case "TM"
    Sheets("sheet1").Range("a" & i & ":z" & i).Copy
Destination:=Sheets("TM").Range("a" &
Sheets("TM").Range("p65356").End(xlUp).Row + 1)

    Case "TJ"
    Sheets("sheet1").Range("a" & i & ":z" & i).Copy
Destination:=Sheets("TJ").Range("a" &
Sheets("TJ").Range("p65356").End(xlUp).Row + 1)

    Case "T1"
        If Sheets("sheet1").Range("Y" & i).Value <= 30 Then
            Sheets("sheet1").Range("a" & i & ":z" & i).Copy
Destination:=Sheets("T1 < 30").Range("a" & Sheets("T1 <
30").Range("p65356").End(xlUp).Row + 1)
        Else
            Sheets("sheet1").Range("a" & i & ":z" & i).Copy
Destination:=Sheets("T1 > 30").Range("a" & Sheets("T1 >
30").Range("p65356").End(xlUp).Row + 1)
        End If

    Case "T2"
        If Sheets("sheet1").Range("Y" & i).Value <= 30 Then
            Sheets("sheet1").Range("a" & i & ":z" & i).Copy
Destination:=Sheets("T2 < 30").Range("a" & Sheets("T2 <
30").Range("p65356").End(xlUp).Row + 1)
        Else
            Sheets("sheet1").Range("a" & i & ":z" & i).Copy
Destination:=Sheets("T2 > 30").Range("a" & Sheets("T2 >
30").Range("p65356").End(xlUp).Row + 1)
        End If


    End Select

Next

Application.DisplayAlerts = True
' create new sheets


End Sub








On Tue, Aug 6, 2013 at 10:21 PM, Geoff <intaminfan...@gmail.com> wrote:

> I made a sample file with hypothetical information since i can't give out
> real addresses and donation history.  In this example, i have 2 without a
> last name and it only skips the first one, again not sure why.  I've also
> attached the code i'm using to run the macro.  Thanks for the help!
>
>
> On Monday, August 5, 2013 6:59:51 PM UTC-7, ashish wrote:
>
>> Can u share a sample file
>>
>>
>> On Mon, Aug 5, 2013 at 10:50 PM, Geoff <intami...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I have a macro written that will check if a value in column X matches a
>>> specified value, if it does the row gets copied onto another tab and then
>>> the macro keeps looping to evaluate all the rows.  However, when cell A# is
>>> blank, but there's data in the rest of the cells in that row the macro will
>>> skip copying the row even though it has the specified value in the X column
>>> cell.  Not sure how to get around this, any help would be appreciated,
>>> thanks.
>>>
>>> --
>>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
>>> It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>>> https://www.facebook.com/**discussexcel<https://www.facebook.com/discussexcel>
>>>
>>> FORUM RULES
>>>
>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>>> will not get quick attention or may not be answered.
>>> 2) Don't post a question in the thread of another member.
>>> 3) Don't post questions regarding breaking or bypassing any security
>>> measure.
>>> 4) Acknowledge the responses you receive, good or bad.
>>> 5) Jobs posting is not allowed.
>>> 6) Sharing copyrighted material and their links is not allowed.
>>>
>>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>>> members are not responsible for any loss.
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "MS EXCEL AND VBA MACROS" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to excel-macros...@**googlegroups.com.
>>> To post to this group, send email to excel-...@googlegroups.com.
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/excel-macros<http://groups.google.com/group/excel-macros>
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> *Regards*
>> * *
>> *Ashish Koul*
>>
>>
>> *Visit*
>> *My Excel Blog <http://www.excelvbamacros.com/>*
>> Like Us on 
>> Facebook<http://www.facebook.com/pages/Excel-VBA-Codes-Macros/151803898222297>
>> Join Us on Facebook <http://www.facebook.com/groups/163491717053198/>
>>
>>
>> P Before printing, think about the environment.
>>
>>
>>
>  --
> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
> https://www.facebook.com/discussexcel
>
> FORUM RULES
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>
> NOTE : Don't ever post confidential data in a workbook. Forum owners and
> members are not responsible for any loss.
> ---
> You received this message because you are subscribed to the Google Groups
> "MS EXCEL AND VBA MACROS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to excel-macros+unsubscr...@googlegroups.com.
> To post to this group, send email to excel-macros@googlegroups.com.
> Visit this group at http://groups.google.com/group/excel-macros.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
*Regards*
* *
*Ashish Koul*


*Visit*
*My Excel Blog <http://www.excelvbamacros.com/>*
Like Us on 
Facebook<http://www.facebook.com/pages/Excel-VBA-Codes-Macros/151803898222297>
Join Us on Facebook <http://www.facebook.com/groups/163491717053198/>


P Before printing, think about the environment.

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to