Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Find a string within a string

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Find a string within a string

On Jan 24, 9:46 pm, El Bee wrote:
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


Try looking at InStr function (Returns a Variant (Long) specifying the
position of the first occurrence of one string within another.)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Find a string within a string

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

"El Bee" wrote:

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

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
Find String in another string - only between spaces Nir Excel Worksheet Functions 9 November 2nd 06 11:31 AM
Find Many String options in ONE String Nir Excel Worksheet Functions 6 October 26th 06 07:13 AM
find string within other string Nir Excel Worksheet Functions 8 October 25th 06 11:27 PM
search a string withing a string : find / search hangs itarnak[_9_] Excel Programming 4 October 24th 05 03:19 PM
find a string inside another string MarkS Excel Programming 1 January 13th 04 02:55 AM


All times are GMT +1. The time now is 10:52 AM.

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"