![]() |
Finding and retrieving info
I wish to search a column for a particular value.
If the value is found, I want to be able to copy all the information in that particular row to a new worksheet. The original worksheet is then searched again for any more occurrences of the value and if found, that row is copied to row 2 of the new worksheet, and so on until the orginal worksheet has been completely searched. Can I write a macro to do that? If so, the next step would be to search a number of columns in the orginal worksheet for various values. If all values are found, the row is copied to the new worksheet, and so on as above. Any ideas would be greatly appreciated Thanks Matthew --- Message posted from http://www.ExcelForum.com/ |
Finding and retrieving info
Matthew McManus < wrote:
I wish to search a column for a particular value. If the value is found, I want to be able to copy all the information in that particular row to a new worksheet. The original worksheet is then searched again for any more occurrences of the value and if found, that row is copied to row 2 of the new worksheet, and so on until the orginal worksheet has been completely searched. Can I write a macro to do that? If the functions in the freely downloadable file at http://home.pacbell.net/beban are available to your workbook, a macro is not required. You can array enter into the first rows of the new worksheet (enoughs rows to accommodate the number of occurrences of the sought value, and enough columns to accommodate a full row) something lke the following: =ArrayRowFilter1(Sheet("whatever")!dataRange,relev ant_column,sought_value) Alan Beban |
Finding and retrieving info
My question would be, what code do you want. Do you want search a range for
multiple instances of a value (see the example code for the FindNext method in VBA help. You have the code). Or do you want to search multiple columns for specific value, with a copy occuring when all values are found in a single row? Or are you asking for two things. Generally, spoon feeding small parts of a problem to the group as single questions is counter productive since while they may appear progressive to you, from a programming standpoint, they may be better accomplished with quite different algorithms - thus asking people to do work which is thrown away. -- Regards, Tom Ogilvy "Matthew McManus " wrote in message ... I wish to search a column for a particular value. If the value is found, I want to be able to copy all the information in that particular row to a new worksheet. The original worksheet is then searched again for any more occurrences of the value and if found, that row is copied to row 2 of the new worksheet, and so on until the orginal worksheet has been completely searched. Can I write a macro to do that? If so, the next step would be to search a number of columns in the orginal worksheet for various values. If all values are found, the row is copied to the new worksheet, and so on as above. Any ideas would be greatly appreciated Thanks Matthew --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 06:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com