Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default Macro to copy text between two different delimeters

I am trying to write a macro in Excel to select text between cells
which contain words.

Two challenges:
1.) I need to search for a cell that contains only one-single word
"item:" and then copy the contents of the cell just-above that cell
2.) I need to search for a cell that contains only one-single word
"component(s):" and then copy all of the rows below that until I find
a cell that contains only the word "Zip"

Any samples would help for either of these challenges
~Vic

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default Macro to copy text between two different delimeters

This is just an example of technique, not a full solution. This macro
searches the active worksheet fin any region you have Selected. If it finds
"item:" it copies the contents of the cell directly above to Sheet2 cell A1:

Sub dossey()
Set rDest = Sheets("Sheet2").Range("A1")
For Each r In Selection
If r.Value = "item:" Then
r.Offset(-1, 0).Copy rDest
Exit Sub
End If
Next
End Sub
--
Gary''s Student - gsnu200713


" wrote:

I am trying to write a macro in Excel to select text between cells
which contain words.

Two challenges:
1.) I need to search for a cell that contains only one-single word
"item:" and then copy the contents of the cell just-above that cell
2.) I need to search for a cell that contains only one-single word
"component(s):" and then copy all of the rows below that until I find
a cell that contains only the word "Zip"

Any samples would help for either of these challenges
~Vic


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
text box insert in Excel - text box lines print on second copy Diana (Berry & Co) Excel Discussion (Misc queries) 0 July 26th 06 04:39 AM
copy text between 2 open workbooks via macro bigdaddy3 Excel Worksheet Functions 2 August 18th 05 06:37 PM
copy text from 1 workbook to another by macro bigdaddy3 Excel Worksheet Functions 0 August 17th 05 06:20 PM
I want to link, not just copy,Word source text to a text box in Ex Carrie K Excel Worksheet Functions 0 August 12th 05 07:58 PM
Macro to delete a text box and copy in new one Dave Excel Discussion (Misc queries) 1 February 18th 05 02:02 AM


All times are GMT +1. The time now is 10:38 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"