Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create Condensed List from Imported Data | Excel Discussion (Misc queries) | |||
Create a Condensed List from Imported Data | Excel Worksheet Functions | |||
Impossible? Condensed search results | Excel Worksheet Functions |