Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
please help simplify
thank you so much. I have one question: i have almost 5000 rows to ru through-is there a way to have it loop through based on the conditio "lease type"? you've been so helpful i hate to even ask but this i way over my head -- acarri ----------------------------------------------------------------------- acarril's Profile: http://www.excelforum.com/member.php...fo&userid=1002 View this thread: http://www.excelforum.com/showthread.php?threadid=26204 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
please help simplify
Assume lease type is in Column E and the values start in row2
set rng = Range(cells(2,"E"),Cells(rows.count,"E").End(xlup) ) for each cell in rng Select Case lcase(cell.Value) Case "temporary" ' process a temporary lease Case "permanent" ' process row as a permanent lease Case "contingent" ' process row as a contingent less CaseElse cell.Select msgbox "Lease type " & cell.Value & " is unknown" End Select Next Assumes there are three types of leases "Temporary", "Permanent", "Conditional" just for illustrative purposes, and that these are the string values that would be found in column E. -- Regards, Tom Ogilvy "acarril" wrote in message ... thank you so much. I have one question: i have almost 5000 rows to run through-is there a way to have it loop through based on the condition "lease type"? you've been so helpful i hate to even ask but this is way over my head. -- acarril ------------------------------------------------------------------------ acarril's Profile: http://www.excelforum.com/member.php...o&userid=10027 View this thread: http://www.excelforum.com/showthread...hreadid=262049 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I need to simplify this... | Excel Worksheet Functions | |||
Need to simplify code | Excel Discussion (Misc queries) | |||
please help simplify | Excel Programming | |||
please help simplify | Excel Programming | |||
Simplify | Excel Programming |