Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
FIND-COPY DIFFERENT WORDS WITH MACRO
Hi,
I am trying to create a macro that will find the word "MONDAY" in column A, then copy "MONDAY" (in every cell down to column A) and stop when it will find the word "TUESDAY" and so on. Can someone help me with this? Thanks for your help!!! Spyros |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
FIND-COPY DIFFERENT WORDS WITH MACRO
hi
I did this years ago but i forgot how i did it so i re-invented the wheel. I don't remember it being this wordy. you may have to change somewhat to fit your data but it should give you the idea. Sub findsomthing() Dim r1 As Range Dim r2 As Range Dim b As Range Dim s As String s = InputBox("enter something to find") Set r1 = Range("A2") Do While Not IsEmpty(r1) Set r2 = r1.Offset(1, 0) If r1.Value = s Then r1.Select Set b = r1 Exit Do End If Set r1 = r2 Loop Do While Not IsEmpty(r1) Set r2 = r1.Offset(1, 0) If r1.Value = s Then Range(b, r1).Select End If Set r1 = r2 Loop Selection.Copy End Sub Post back it questions Regards FSt1 "Spiros" wrote: Hi, I am trying to create a macro that will find the word "MONDAY" in column A, then copy "MONDAY" (in every cell down to column A) and stop when it will find the word "TUESDAY" and so on. Can someone help me with this? Thanks for your help!!! Spyros |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to find matching date and copy values to another sheet | Excel Discussion (Misc queries) | |||
Where can I find a printed list of VBA code words | Excel Discussion (Misc queries) | |||
Macro to find copy "header" and paste | Excel Discussion (Misc queries) | |||
Macro to find, copy, and paste until value change | Excel Worksheet Functions | |||
Need to find the 1st two characters of the 1st two words | Excel Worksheet Functions |