Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Need help on creating a routine that loops down through a
spreadsheet's rows that contain entries and compares the entry in column 1 (State abrevation) with column 2 entry (shipment method). Specificly I want to return a msgbox to the user when the state = "HI" or "AK" and the ship method is "ground", and then quits the vba form so the user can correct the situation. Thnaks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like this:
Option Explicit Sub testme() Dim myCell As Range Dim myRng As Range With Worksheets("sheet1") Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp)) End With For Each myCell In myRng.Cells With myCell Select Case LCase(.Value) Case "ak", "hi" .Select MsgBox "error on row: " & .Row Exit Sub Case Else 'do nothing End Select End With Next myCell End Sub (not sure how you're userform works, though.) Couldn't they just take the interstate to hi? Rick K wrote: Need help on creating a routine that loops down through a spreadsheet's rows that contain entries and compares the entry in column 1 (State abrevation) with column 2 entry (shipment method). Specificly I want to return a msgbox to the user when the state = "HI" or "AK" and the ship method is "ground", and then quits the vba form so the user can correct the situation. Thnaks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search / Find Function | Excel Worksheet Functions | |||
Search / find Formula | Excel Worksheet Functions | |||
IF with Search/Find??? | Excel Worksheet Functions | |||
Find and search by column | Excel Discussion (Misc queries) | |||
Can Search find 2 or more "/"? | Excel Discussion (Misc queries) |