Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi I have a column containing text phrases in each cell, if there's an word in the cell ends with "abc", I want that phrase to be in a ne column. Data in each cell: appleabc is not red roadabc is long green apple roadblock apple is fruitabc sweet fruit Output(in a new column): appleabc is not red roadabc is long apple is fruitabc Here's the code that doesn't work ![]() Sub PrintEnd_ING() Dim Cell As Range Dim myString As String Application.DisplayAlerts = False Application.ScreenUpdating = False x = ActiveCell.Row y = ActiveCell.Column For Each Cell In Range(Selection, Selection.End(xlDown)) myString = Cells(x, y).Value If myString Like "*abc" Or myString = "*abc? " Then ActiveSheet.Cells(x, y + 3).Value = myString ActiveSheet.Cells(x, y + 4).Value = Cell.Offset(0, 1).Value x = x + 1 End If Next Application.DisplayAlerts = True Application.ScreenUpdating = True End Su -- KH_G ----------------------------------------------------------------------- KH_GS's Profile: http://www.excelforum.com/member.php...fo&userid=3292 View this thread: http://www.excelforum.com/showthread.php?threadid=52911 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Return Text based upon text matching | Excel Worksheet Functions | |||
matching text to text in excel | Excel Worksheet Functions | |||
Help with Matching Text Fields - Then Moving the Matching Cells Side by Side | Excel Discussion (Misc queries) | |||
Matching Text | Excel Worksheet Functions | |||
Matching 2 text columns | Excel Discussion (Misc queries) |