LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Can this be condensed



Sub Macro2()
'
With Worksheets(2).Range("B4:U4")
Set c = .Find("Contract", LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
contract = firstAddress
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
With Worksheets(2).Range("B4:U4")
Set c = .Find("Upgrade", LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
upgrade = firstAddress
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
With Worksheets(2).Range("B4:U4")
Set c = .Find("Prepay", LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Prepay = firstAddress
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

MsgBox "Contract = " & contract & vbCr & vbCr _
& "Upgrade = " & upgrade & vbCr & vbCr _
& "Prepay = " & Prepay

End Sub

Regards
Neil

*** Sent via Developersdex http://www.developersdex.com ***
 
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
Create Condensed List from Imported Data Lemmesee Excel Discussion (Misc queries) 2 October 16th 09 05:45 PM
Create a Condensed List from Imported Data Lemmesee Excel Worksheet Functions 3 October 16th 09 02:34 AM
Impossible? Condensed search results LiAD Excel Worksheet Functions 8 March 30th 09 02:07 PM


All times are GMT +1. The time now is 05:39 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"