Grabbing string values from the end of a string of an unknown length

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

I have 3 cells containing string values:

Classification_Asset Class
Classification_Risk Classification
Classification_Geographical Breakdown

I want to tell the code to look in each cell along a row until it finds the
string value: Classification_

Whsn it find it i then want it to pass the rest of the string to another
variable, something like this:

Dim sFirstStringValue As String
Dim sSecondStringValue As String


sFirstStringValue = "Classification_"
sSecondStringValue = Everything thatcomesafterfiststringvalue

Help much appreciated,

Regards, Mark


.



Relevant Pages

  • Re: No solution - Macros
    ... Dim C As Range ... Dim NameAddresses As String ... The coloured cells go horizontal, left to right, one colour ... what you have with how you think you need to code the macro... ...
    (microsoft.public.excel.programming)
  • Re: Find string in Data
    ... possible to process the data from its source rather than putting it in cells ... Dim Contents As String ... Dim Fields() As String ...
    (microsoft.public.excel.programming)
  • Re: Find string in Data
    ... Your question asking if there is a way to remove data says to me that you are loading the data into your cells as a convenience for the calculation and not because it needs to be displayed to the user. ... Private Sub Worksheet_Change ... Sub GetAssignments(Cell As Range, Phrase As String) ... Dim Contents As String ...
    (microsoft.public.excel.programming)
  • Re: No solution - Macros
    ... Or the codes in the text string? ... So the job of the macro is to turn the above ... As you say the cells that do not display a number are not empty so the macro ...
    (microsoft.public.excel.programming)
  • Re: No solution - Macros
    ... The coloured cells go horizontal, left to right, one colour ... The colour is applied to the text string W W..etc, ... what you have with how you think you need to code the macro... ... empty box at the top left starting in cell A2. ...
    (microsoft.public.excel.programming)