Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Finding a specific text

Here is what I'm attempting to do...
Check a large range of cells for the text "#"
Once I find a cell that has the "#" text, I need to take the 4 characters
right of the "#" text and place it into a different column

Thanks
--
Helping Is always a good thing
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Finding a specific text

Simple solution to get you started; no code.
=MID(A7,FIND("#",A7)+1,4)

I'll try to come up with a solution that loops through the data later, when
I have more time.

Regards,
Ryan---

--
RyGuy


"QuietMan" wrote:

Here is what I'm attempting to do...
Check a large range of cells for the text "#"
Once I find a cell that has the "#" text, I need to take the 4 characters
right of the "#" text and place it into a different column

Thanks
--
Helping Is always a good thing

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Finding a specific text

Thanks,

I have to do 3 checks also when looping through the data
what do you think is the best way to lop through (fastest)
--
Helping Is always a good thing


"ryguy7272" wrote:

Simple solution to get you started; no code.
=MID(A7,FIND("#",A7)+1,4)

I'll try to come up with a solution that loops through the data later, when
I have more time.

Regards,
Ryan---

--
RyGuy


"QuietMan" wrote:

Here is what I'm attempting to do...
Check a large range of cells for the text "#"
Once I find a cell that has the "#" text, I need to take the 4 characters
right of the "#" text and place it into a different column

Thanks
--
Helping Is always a good thing

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Finding a specific text

Finally done with Fluid Dynamics so I can revisit. Try this:

Sub Convert()

Range("A1").Select
For X = 1 To 1
Dim redRng As Range

Set redRng = Range("A1", Range("A100").End(xlUp))
For Each cell In redRng

If cell.Value < "" Then
ActiveCell.Offset(0, 2).Select
ActiveCell.FormulaR1C1 = "=MID(RC[-2],FIND(""#"",RC[-2])+1,4)"
ActiveCell.Offset(1, -2).Select
End If

Next cell

Next X
End Sub

Regards,
Ryan---


--
RyGuy


"QuietMan" wrote:

Thanks,

I have to do 3 checks also when looping through the data
what do you think is the best way to lop through (fastest)
--
Helping Is always a good thing


"ryguy7272" wrote:

Simple solution to get you started; no code.
=MID(A7,FIND("#",A7)+1,4)

I'll try to come up with a solution that loops through the data later, when
I have more time.

Regards,
Ryan---

--
RyGuy


"QuietMan" wrote:

Here is what I'm attempting to do...
Check a large range of cells for the text "#"
Once I find a cell that has the "#" text, I need to take the 4 characters
right of the "#" text and place it into a different column

Thanks
--
Helping Is always a good thing

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Finding a specific text

Thanks for the Help...

I came up with this code

Cells(20000, 14).Select
Selection.End(xlUp).Select
EndRow = ActiveCell.Row
For X = 1 To EndRow
Eval = Left(Cells(X, 1), 10)
If Eval < " CURRENCY" Then GoTo No_Find
Entity = Mid(Cells(X, 1), Application.Find("#", Cells(X, 1)) +
1, 4)
Do Until Cells(X, 1) = "AVAILABLE ROOMS"
X = X + 1
Loop
Range("A" & X, Range("A" & X).End(xlDown)).Offset(0, 15) = Entity
Cells(X, 1).Select
Selection.End(xlDown).Select
X = ActiveCell.Row
No_Find:
Next X

Works great but it enters a value for the entity example: Entity = "0012"
but it enters 12 in the cell any Ideas?

--
Helping Is always a good thing


"ryguy7272" wrote:

Finally done with Fluid Dynamics so I can revisit. Try this:

Sub Convert()

Range("A1").Select
For X = 1 To 1
Dim redRng As Range

Set redRng = Range("A1", Range("A100").End(xlUp))
For Each cell In redRng

If cell.Value < "" Then
ActiveCell.Offset(0, 2).Select
ActiveCell.FormulaR1C1 = "=MID(RC[-2],FIND(""#"",RC[-2])+1,4)"
ActiveCell.Offset(1, -2).Select
End If

Next cell

Next X
End Sub

Regards,
Ryan---


--
RyGuy


"QuietMan" wrote:

Thanks,

I have to do 3 checks also when looping through the data
what do you think is the best way to lop through (fastest)
--
Helping Is always a good thing


"ryguy7272" wrote:

Simple solution to get you started; no code.
=MID(A7,FIND("#",A7)+1,4)

I'll try to come up with a solution that loops through the data later, when
I have more time.

Regards,
Ryan---

--
RyGuy


"QuietMan" wrote:

Here is what I'm attempting to do...
Check a large range of cells for the text "#"
Once I find a cell that has the "#" text, I need to take the 4 characters
right of the "#" text and place it into a different column

Thanks
--
Helping Is always a good thing



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
Finding specific text in ranges timmulla Excel Discussion (Misc queries) 3 January 24th 07 06:01 PM
Finding the text written in specific color Jimish Excel Programming 1 May 30th 06 01:55 PM
Finding specific text in string - Part II Hardip Excel Worksheet Functions 1 April 8th 06 02:20 PM
Finding specific text in a string Hardip Excel Worksheet Functions 5 April 8th 06 01:16 PM
Finding Specific Text in a Text String Peter Gundrum Excel Worksheet Functions 9 April 10th 05 07:21 PM


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