please help simplify

  • Thread starter Thread starter acarril
  • Start date Start date
A

acarril

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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top