Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.newusers
|
|||
|
|||
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
Posted to microsoft.public.excel.newusers
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
text box insert in Excel - text box lines print on second copy | Excel Discussion (Misc queries) | |||
copy text between 2 open workbooks via macro | Excel Worksheet Functions | |||
copy text from 1 workbook to another by macro | Excel Worksheet Functions | |||
I want to link, not just copy,Word source text to a text box in Ex | Excel Worksheet Functions | |||
Macro to delete a text box and copy in new one | Excel Discussion (Misc queries) |