Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Find a string within a string

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
El Bee - 25 Jan 2008 02:46 GMT
I have two columns that contain data in worksheet "Programs"

Access Level    Program Name
94 95 99                   ITEMMGMT
27 99                   ORDERMGT
95 97 99                   PURCHMGT

In another worksheet (Data), same workbook, I have multiple rows of data
with in some of these rows will contain the program name above and one of the
1-3 access levels in the associated column in "Programs".

I need to find each row that has the corresponding program name in Cell D
and one of the 2-3 number values in Cell C.  
If found then I need to copy that row to another worksheed (Profiles) using
the transpose option.

I have just discovered this link within the Excel discussion group and I'm
finding a wealth of information but unless I'm searching incorrectly I can't
find an example to work from.

Thanks for your help,

Larry

I want to sea
dbKemp - 25 Jan 2008 11:38 GMT
> I have two columns that contain data in worksheet "Programs"
>
[quoted text clipped - 21 lines]
>
> I want to sea

Try looking at InStr function (Returns a Variant (Long) specifying the
position of the first occurrence of one string within another.)
Joel - 25 Jan 2008 12:06 GMT
The code would be something like this

SearchData = "abc"
With Sheets("Data")
 Set c = .Columns.Find(what:=SearchData, LookIn:=xlValues, lookat:=xlWhole)
 If Not c Is Nothing Then
     Set CopyRange = .Range(.Cells(c.Row, "A"), .Cells(c.Row, "Z"))
    CopyRange.Copy
    Sheets("NewSheet").Range("A1").PasteSpecial _
       Paste:=xlPasteAll, _
       Operation:=xlNone, _
       SkipBlanks:=False, _
       Transpose:=True
 End If

End With

> I have two columns that contain data in worksheet "Programs"
>
[quoted text clipped - 21 lines]
>
> I want to sea
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.