![]() |
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 |
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 |
All times are GMT +1. The time now is 01:55 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com