LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Looping through text

Morning group,

I had a question in reference to looping through a text
string to find text within the string.

Basically what I'm trying to do is have a macro go into a
cell and see if the specified text exists in that string.
The string is located 31 columns to the left of the
starting position of data entry but when i go to look up
the value i get an error. Thanks in advance. Code is down
below

Regards,

Jeff


Sub Textloop()

Dim IGR As Integer
Dim BUnt As String
Dim CellSr As Range, Stgsr As String
BUnt = "shoes"
Stgsr = "XYZ"
ActiveCell.Select

''''This doesnt work as a value i need it to read 31 cells
'''to the left of where i am this doesn't work
CellSr = Range(0, -31).Value

'''Finds the text Search string
For IGR = 1 To Len(CellSr)
Debug.Print Mid(UCase(CellSr), IGR, Len(Stgsr))
If Mid(UCase(CellSr), IGR, Len(Stgsr)) = UCase(Stgsr)
Then
'''''''''Trigger now sets to another coumn
ActiveCell.Value = BUnt
End If
Next IGR


End Sub

 
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
Looping Text Bob Myles Excel Programming 4 April 25th 04 04:36 AM
Looping input from a text box morry[_7_] Excel Programming 0 February 13th 04 09:13 PM
looping through text boxes Ian Mangelsdorf Excel Programming 1 January 20th 04 06:11 AM
building a text string while looping though a worksheet Phillips Excel Programming 4 December 10th 03 08:31 AM
Looping through Text boxes Fred[_9_] Excel Programming 0 July 9th 03 03:06 AM


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