VBA: Searching for a range in a worksheet.
-
Hi, Is there a VBA technique to search for existence of a range of cells containing certain values and if such range(s) exists severally in a worksheet return an array of these ranges or at least their coordinates? Regards, Cyril
Excel Ranges - Stackoverflow[^]
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
Hi, Is there a VBA technique to search for existence of a range of cells containing certain values and if such range(s) exists severally in a worksheet return an array of these ranges or at least their coordinates? Regards, Cyril
I'm not clear on what you want to search and for what, so perhaps you could clarify. Do you want to search - a range of cells for a value that fits in one cell and return all the cells containing the value? - a range of cells for a value that may occur across cells? - a spreadsheet for a specific sequence of cell vales?
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
I'm not clear on what you want to search and for what, so perhaps you could clarify. Do you want to search - a range of cells for a value that fits in one cell and return all the cells containing the value? - a range of cells for a value that may occur across cells? - a spreadsheet for a specific sequence of cell vales?
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
Or maybe a rectangular range of cells, sized A by B, containing each and every value of another rectangular range of cells, sized C by D, where A*B equals C*D and the order of the matching cells doesn't matter. :-D
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
Or maybe a rectangular range of cells, sized A by B, containing each and every value of another rectangular range of cells, sized C by D, where A*B equals C*D and the order of the matching cells doesn't matter. :-D
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
... contains the equivalent words, if translated to Dutch?
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
I'm not clear on what you want to search and for what, so perhaps you could clarify. Do you want to search - a range of cells for a value that fits in one cell and return all the cells containing the value? - a range of cells for a value that may occur across cells? - a spreadsheet for a specific sequence of cell vales?
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
Hi Walt, I think the 3rd is more of what I require. I am formatting reports of a system that dumps in ASCII format, and it places several reports sequentially on one text file. I figured to isolate these reports the best option is to upload into excel and search for the cells that contain the header fields and thus know where each report begins as the report offers no other fields/tags that indicate report start and end. Thus I want to iterate and find all ranges where cell 1 in the range contains value 1, cell 2 contains value 2, cell 3 contains value 3 etc thus indicating where each report begins. A bit messy but seems to be the only way out Regards
modified on Wednesday, January 12, 2011 1:32 AM
-
Or maybe a rectangular range of cells, sized A by B, containing each and every value of another rectangular range of cells, sized C by D, where A*B equals C*D and the order of the matching cells doesn't matter. :-D
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.