Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Parsing, mid, left, trim or right to find specific word in string

Hi All,

I was hoping to get a hint or two to find a specific word, which I'll
use to determine which worksheet to place the string in.

I would really appreciate only hints as to the process.

Thanks in advance.

Yours truly,

wccc.pctutor
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Parsing, mid, left, trim or right to find specific word in string

Hint: InStr
--
Jim Cone
Portland, Oregon USA



"wccc.pctutor"

wrote in message
Hi All,

I was hoping to get a hint or two to find a specific word, which I'll
use to determine which worksheet to place the string in.
I would really appreciate only hints as to the process.
Thanks in advance.
Yours truly,
wccc.pctutor
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Parsing, mid, left, trim or right to find specific word in string

try Searching the VBA Help Files for the InStr Function

"wccc.pctutor" wrote:

Hi All,

I was hoping to get a hint or two to find a specific word, which I'll
use to determine which worksheet to place the string in.

I would really appreciate only hints as to the process.

Thanks in advance.

Yours truly,

wccc.pctutor

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Parsing, mid, left, trim or right to find specific word in string

Hint: The Like Operator.

--
Rick (MVP - Excel)


"wccc.pctutor" wrote in message
...
Hi All,

I was hoping to get a hint or two to find a specific word, which I'll
use to determine which worksheet to place the string in.

I would really appreciate only hints as to the process.

Thanks in advance.

Yours truly,

wccc.pctutor


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Parsing, mid, left, trim or right to find specific word in string

Example: On the First worksheet in cells, A1 & A2 place these two words

A
1 Aardvark
2 Anteater

Then in the VBE paste this,

Option Explicit
Sub DoStuff()
Dim Start As Integer
Dim StringBeingSearched As String
Dim StringBeingSought As String
Dim ws As Worksheet
Dim LastRow As Long
Dim RangeToSearch As Range
Dim i As Variant

Set ws = ActiveWorkbook.Worksheets(1)
LastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
Set RangeToSearch = Range("A1:A" & LastRow)
Start = 1
StringBeingSought = "Aa"

For Each i In RangeToSearch
If InStr(Start, i, StringBeingSought) Then
MsgBox i
End If
Next
End Sub

Notice that the msgbox only returns Aardvark not anteater. The same can be
applied for any string Hope that helps.


"wccc.pctutor" wrote:

Hi All,

I was hoping to get a hint or two to find a specific word, which I'll
use to determine which worksheet to place the string in.

I would really appreciate only hints as to the process.

Thanks in advance.

Yours truly,

wccc.pctutor



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Parsing, mid, left, trim or right to find specific word in string

The OP specifically asked for hints only (not full code).

--
Rick (MVP - Excel)


"Office_Novice" wrote in message
...
Example: On the First worksheet in cells, A1 & A2 place these two words

A
1 Aardvark
2 Anteater

Then in the VBE paste this,

Option Explicit
Sub DoStuff()
Dim Start As Integer
Dim StringBeingSearched As String
Dim StringBeingSought As String
Dim ws As Worksheet
Dim LastRow As Long
Dim RangeToSearch As Range
Dim i As Variant

Set ws = ActiveWorkbook.Worksheets(1)
LastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
Set RangeToSearch = Range("A1:A" & LastRow)
Start = 1
StringBeingSought = "Aa"

For Each i In RangeToSearch
If InStr(Start, i, StringBeingSought) Then
MsgBox i
End If
Next
End Sub

Notice that the msgbox only returns Aardvark not anteater. The same can be
applied for any string Hope that helps.


"wccc.pctutor" wrote:

Hi All,

I was hoping to get a hint or two to find a specific word, which I'll
use to determine which worksheet to place the string in.

I would really appreciate only hints as to the process.

Thanks in advance.

Yours truly,

wccc.pctutor


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Parsing, mid, left, trim or right to find specific word in string

Hi All,

You guys have been really gracious.

I will be, intently, reading each of your responses' and look each one
up in the Help Section.

If I "fall, stumble or get stuck" I will be back

Again, thank you all for taking the time to answer my post.

Now to my wife's hone-do-list.

Later,

wccc.pctutor

Office_Novice:
Example: On the First worksheet in cells, A1 & A2 place these two

words

A
1 Aardvark
2 Anteater

Then in the VBE paste this,

Option Explicit
Sub DoStuff()
Dim Start As Integer
Dim StringBeingSearched As String
Dim StringBeingSought As String
Dim ws As Worksheet
Dim LastRow As Long
Dim RangeToSearch As Range
Dim i As Variant

Set ws = ActiveWorkbook.Worksheets(1)
LastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
Set RangeToSearch = Range("A1:A" & LastRow)
Start = 1
StringBeingSought = "Aa"

For Each i In RangeToSearch
If InStr(Start, i, StringBeingSought) Then
MsgBox i
End If
Next
End Sub

Notice that the msgbox only returns Aardvark not anteater. The same

can be
applied for any string Hope that helps.


"wccc.pctutor" wrote:

Hi All,

I was hoping to get a hint or two to find a specific word, which

I'll
use to determine which worksheet to place the string in.

I would really appreciate only hints as to the process.

Thanks in advance.

Yours truly,

wccc.pctutor

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
=TRIM(LEFT(B47,FIND(" ",B47)-1)) Jim Excel Discussion (Misc queries) 4 January 28th 10 08:45 PM
=TRIM(LEFT(B50,FIND(" ",B50)-1)) Jim Excel Discussion (Misc queries) 4 January 14th 10 10:56 PM
how we find specific word from string in excel and compaire it. Vishnu Excel Worksheet Functions 2 April 18th 09 07:51 AM
trim left of a found word in a text variable MervB Excel Programming 6 November 15th 05 10:10 PM
trim a string by specific number of characters windyoldman Excel Discussion (Misc queries) 2 July 13th 05 01:53 PM


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

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

About Us

"It's about Microsoft Excel"