PDA

View Full Version : macro search



oleg_v
04-18-2010, 02:29 AM
hi

i need a help with a macro that will search for the word "program" in column "B" and after finding the word the macro will copy the word "program" and the word that in the same row but column "h" to sheet2 cells "A1"and"B1"



thanks

GTO
04-18-2010, 03:02 AM
Presumably we are just looking for 'program' once. From the bottom or from the top?

oleg_v
04-18-2010, 03:08 AM
from the top
and might be that the word program will repeat several times but in the same column alwyas

GTO
04-18-2010, 03:12 AM
But you said that we'll be returning values to A1 and B1. Are we returning the last 'program' found, or the first?

oleg_v
04-18-2010, 03:20 AM
i am sorry my English is not very good i might explain no
quite clear the values will return starting at A1 and B1 continue to A2 and B2
and so on

all of the program need to be returning with their values


sorry

Oleg

mdmackillop
04-18-2010, 03:38 AM
Sub ProgramData()
Columns(2).AutoFilter Field:=1, Criteria1:="*program*"
Intersect(Range("B:B,H:H"), ActiveSheet.UsedRange).Copy Sheets(2).Cells(1, 1)
Application.CutCopyMode = False
Columns(2).AutoFilter
End Sub

oleg_v
04-18-2010, 03:52 AM
say

if i want to change in this macro that after finding the "program" the word in column "h" that should be copied is to rows down


thanks

mdmackillop
04-18-2010, 03:58 AM
Sorry, I don't follow what you mean.

oleg_v
04-18-2010, 04:14 AM
hi
please see the attachment sheet1 before and sheet2 after

mdmackillop
04-18-2010, 04:27 AM
My solution answers your original question. It is not amenable to change to your revised layout.

oleg_v
04-18-2010, 04:31 AM
hi


what i need to do know
open a new thread ?

i did not know

mdmackillop
04-18-2010, 04:39 AM
On second thoughts there is a simple method. Add two cells in B1:B2 to align the data, run the code then delete them.

oleg_v
04-18-2010, 04:52 AM
can you show me in my example
i do not know how to do this

mdmackillop
04-18-2010, 04:58 AM
Try recording a macro to do this. We are here to assist, not to provide a free coding service.

Steveclark
04-20-2010, 04:32 AM
Macros Search are a feature of Live Search that make results more relevant for a given search topic. This is done by easily using, creating and sharing customized sets of search engine rules.

mdmackillop
04-20-2010, 05:16 AM
Macros Search are a feature of Live Search that make results more relevant for a given search topic. This is done by easily using, creating and sharing customized sets of search engine rules.
Sorry, I don't see the relevance to the question. Can you clarify please?