ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   extracting a string from a cell (https://www.excelbanter.com/excel-programming/344731-extracting-string-cell.html)

cjsmith22[_3_]

extracting a string from a cell
 

is there any way to extract whatever string is in a particular cell i
order to then compare that string with strings in cells in othe
ranges

--
cjsmith2
-----------------------------------------------------------------------
cjsmith22's Profile: http://www.excelforum.com/member.php...fo&userid=2852
View this thread: http://www.excelforum.com/showthread.php?threadid=48215


Nick Hodge

extracting a string from a cell
 
Something like this works comparing values in A1 and A2

Sub StrComp()
Dim myString As String
Dim ans As Boolean
myString = Range("A1").Value
ans = InStr(1, myString, Range("A2"))
MsgBox ans
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"cjsmith22" wrote
in message ...

is there any way to extract whatever string is in a particular cell in
order to then compare that string with strings in cells in other
ranges?


--
cjsmith22
------------------------------------------------------------------------
cjsmith22's Profile:
http://www.excelforum.com/member.php...o&userid=28528
View this thread: http://www.excelforum.com/showthread...hreadid=482151





All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com