LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Macro - searches for key word in a column and concatenates ent

Many thanks !

"Dave Peterson" wrote:

I didn't notice you wanted it contiguous cells.

I'd add a filter and show the non-blanks, but if that doesn't help:

Option Explicit
Sub testme()
Dim myCell As Range
Dim myRng As Range
Dim DestCell As Range
Dim myWord As String

myWord = "house"

With Worksheets("Sheet1")
Set myRng = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))
Set DestCell = .Range("C1")
End With

For Each myCell In myRng.Cells
With myCell
If LCase(.Value) = LCase(myWord) Then
DestCell.Value = .Value & .Offset(0, 1).Value
Set DestCell = DestCell.Offset(1, 0)
End If
End With
Next myCell

End Sub

andrei wrote:

Thanks guys . Both functions work . I will try to manage with them . I
prefered a macro that moves the concatenated results in a column as i
explained in first post for the following reason :

The cells i have to process from 2 columns are from something like A1B1 ,
A9B9 , A12B12 , A25B25 going to something like A10000B10000 ( without a clear
pattern that i have content every 10th cell , it's random ) . That's why i
needed the results to be one below another in same column ( say from C1 to
C100 )

If a macro can be done , many thanks in advance


--

Dave Peterson

 
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
alphabetize entire rows by first word of first column Cindy Sue Excel Discussion (Misc queries) 5 February 23rd 10 08:05 PM
Need macro that concatenates cells with text andrei Excel Programming 7 September 27th 09 04:06 PM
change first letter of a word for an entire column lori12844 Excel Discussion (Misc queries) 5 May 30th 07 06:06 AM
How can you write a formula that searches for a particular word? trainer07 Excel Programming 1 August 22nd 06 05:25 PM
Getting valid web searches and avoiding sites that contaminate web searches David McRitchie New Users to Excel 1 June 13th 06 03:00 AM


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

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"