Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need to simplify this... j5b9721 Excel Worksheet Functions 5 July 23rd 09 09:03 AM
Need to simplify code alexwren Excel Discussion (Misc queries) 7 August 15th 06 08:07 PM
please help simplify acarril[_10_] Excel Programming 1 September 21st 04 07:39 PM
please help simplify acarril[_9_] Excel Programming 1 September 21st 04 05:36 PM
Simplify Josh[_7_] Excel Programming 4 January 9th 04 12:16 AM


All times are GMT +1. The time now is 09:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"