Results 1 to 3 of 3

Thread: [RESOLVED] Macro does not work

  1. #1

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Resolved [RESOLVED] Macro does not work

    Not very familiar with excel 2000
    First time i used this macro it worked on another worksheet, but not this one

    Code:
    Public Sub RemoveRows()
    Dim SearchString As String
    Dim i As LongName:  Excel.jpg
    Views: 198
    Size:  12.5 KB
    SearchString = "Authorization"
    i = 1
    
    Do While i <= ThisWorkbook.ActiveSheet.Range("A1").CurrentRegion.Rows.Count
    Debug.Print ThisWorkbook.ActiveSheet.Cells(i, 3).Text
        If InStr(1, ThisWorkbook.ActiveSheet.Cells(i, 3).Text, SearchString, vbTextCompare) > 0 Then
            ThisWorkbook.ActiveSheet.Cells(i, 1).EntireRow.Delete
        Else
            i = i + 1
        End If
    Loop

    Debug giving these results
    33
    39
    free
    44
    35
    what is the problem ?
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  2. #2
    Fanatic Member
    Join Date
    Feb 2013
    Posts
    985

    Re: Macro does not work

    Is the active sheet the sheet you think it is?
    i cannot see your data the image is not clear so im not sure where the data might be coming from.
    Yes!!!
    Working from home is so much better than working in an office...
    Nothing can beat the combined stress of getting your work done on time whilst
    1. one toddler keeps pressing your AVR's power button
    2. one baby keeps crying for milk
    3. one child keeps running in and out of the house screaming and shouting
    4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
    5. working at 1 O'clock in the morning because nobody is awake at that time
    6. being grossly underpaid for all your hard work


  3. #3

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: Macro does not work

    Thanks got it to work by looping from the bottom
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width