Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default 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
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
Macro to find matching date and copy values to another sheet Tiger Excel Discussion (Misc queries) 3 August 13th 07 01:45 PM
Where can I find a printed list of VBA code words mja Excel Discussion (Misc queries) 1 July 11th 06 10:47 PM
Macro to find copy "header" and paste RunsWithKnives Excel Discussion (Misc queries) 3 March 27th 06 05:55 AM
Macro to find, copy, and paste until value change Valerie Excel Worksheet Functions 4 January 26th 06 04:10 AM
Need to find the 1st two characters of the 1st two words Tom Excel Worksheet Functions 2 April 21st 05 02:10 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"