Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a comparison not case sensitive.

Status
Not open for further replies.

cboz

Technical User
Dec 24, 2002
42
US
How do I make this not case sensitive?

Sub InsertRow()
Range("a2").Select

Do Until ActiveCell = ""

If ActiveCell <> ActiveCell.Offset(1, 0) Then
ActiveCell.Offset(1, 0).Select
Selection.EntireRow.Insert Shift = xlDown

Else
End If
ActiveCell.Offset(1, 0).Select
Loop
Range("A1").Activate

End Sub
 
Try:
Code:
Sub InsertRow()
Range("a2").Select

    Do Until ActiveCell = ""
    
        If Ucase(ActiveCell) <> Ucase(ActiveCell.Offset(1, 0)) Then
             ActiveCell.Offset(1, 0).Select
             Selection.EntireRow.Insert Shift = xlDown
            
         Else
        End If
        ActiveCell.Offset(1, 0).Select
    Loop
    Range("A1").Activate

End Sub
 
Thanks. That works perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top