Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
Good morning,
I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
Create a worksheet Summary and change the worksheet name that you are
searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
Hello,
When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
You need to make two changes
1) change this line to match the sheet name you are working with With Sheets("Sheet1") 2) Add a worksheet named SUMMARY to your workbook. "fgwiii" wrote: Hello, When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
Hello,
Sorry to be a pain, but I have made the changes but I am now getting a new error: Run-time error '438': object doesn't support this property or method. Just as an FYI - The date in my sheet covers columns A1 to R1 all the way down to row 30134. Thank you, Fred "Joel" wrote: You need to make two changes 1) change this line to match the sheet name you are working with With Sheets("Sheet1") 2) Add a worksheet named SUMMARY to your workbook. "fgwiii" wrote: Hello, When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
from
Set c = .FindNext(c) to Set c = .Cells.FindNext(c) "fgwiii" wrote: Hello, Sorry to be a pain, but I have made the changes but I am now getting a new error: Run-time error '438': object doesn't support this property or method. Just as an FYI - The date in my sheet covers columns A1 to R1 all the way down to row 30134. Thank you, Fred "Joel" wrote: You need to make two changes 1) change this line to match the sheet name you are working with With Sheets("Sheet1") 2) Add a worksheet named SUMMARY to your workbook. "fgwiii" wrote: Hello, When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
I was not sure were to put the code, but I tried it in several places and
each time I received errors or it would not compile. Thanks Fred "Joel" wrote: from Set c = .FindNext(c) to Set c = .Cells.FindNext(c) "fgwiii" wrote: Hello, Sorry to be a pain, but I have made the changes but I am now getting a new error: Run-time error '438': object doesn't support this property or method. Just as an FYI - The date in my sheet covers columns A1 to R1 all the way down to row 30134. Thank you, Fred "Joel" wrote: You need to make two changes 1) change this line to match the sheet name you are working with With Sheets("Sheet1") 2) Add a worksheet named SUMMARY to your workbook. "fgwiii" wrote: Hello, When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
Sub MakeReport()
RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address End With Set c = .Cells.FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: I was not sure were to put the code, but I tried it in several places and each time I received errors or it would not compile. Thanks Fred "Joel" wrote: from Set c = .FindNext(c) to Set c = .Cells.FindNext(c) "fgwiii" wrote: Hello, Sorry to be a pain, but I have made the changes but I am now getting a new error: Run-time error '438': object doesn't support this property or method. Just as an FYI - The date in my sheet covers columns A1 to R1 all the way down to row 30134. Thank you, Fred "Joel" wrote: You need to make two changes 1) change this line to match the sheet name you are working with With Sheets("Sheet1") 2) Add a worksheet named SUMMARY to your workbook. "fgwiii" wrote: Hello, When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
Okay we are getting somewhere!
When I run the code and while watching the Summary page I see several header rows appear in cell A1 but only for a second until it is done running. Cell a1 contains "EXAM_DT_FUL" amd cell a2 contains "$S$1" Is it possible for not only the header rows, but actual data to be listed in the summary sheet? Thanks, Fred "Joel" wrote: Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address End With Set c = .Cells.FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: I was not sure were to put the code, but I tried it in several places and each time I received errors or it would not compile. Thanks Fred "Joel" wrote: from Set c = .FindNext(c) to Set c = .Cells.FindNext(c) "fgwiii" wrote: Hello, Sorry to be a pain, but I have made the changes but I am now getting a new error: Run-time error '438': object doesn't support this property or method. Just as an FYI - The date in my sheet covers columns A1 to R1 all the way down to row 30134. Thank you, Fred "Joel" wrote: You need to make two changes 1) change this line to match the sheet name you are working with With Sheets("Sheet1") 2) Add a worksheet named SUMMARY to your workbook. "fgwiii" wrote: Hello, When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#10
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
Yes. Where does the data appear with respect to the header row. Like in the
next Row colum D. Is the Data more than one Row. ? Does the number of Rows end with a Blank Row? "fgwiii" wrote: Okay we are getting somewhere! When I run the code and while watching the Summary page I see several header rows appear in cell A1 but only for a second until it is done running. Cell a1 contains "EXAM_DT_FUL" amd cell a2 contains "$S$1" Is it possible for not only the header rows, but actual data to be listed in the summary sheet? Thanks, Fred "Joel" wrote: Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address End With Set c = .Cells.FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: I was not sure were to put the code, but I tried it in several places and each time I received errors or it would not compile. Thanks Fred "Joel" wrote: from Set c = .FindNext(c) to Set c = .Cells.FindNext(c) "fgwiii" wrote: Hello, Sorry to be a pain, but I have made the changes but I am now getting a new error: Run-time error '438': object doesn't support this property or method. Just as an FYI - The date in my sheet covers columns A1 to R1 all the way down to row 30134. Thank you, Fred "Joel" wrote: You need to make two changes 1) change this line to match the sheet name you are working with With Sheets("Sheet1") 2) Add a worksheet named SUMMARY to your workbook. "fgwiii" wrote: Hello, When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#11
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
Somehow an instruction is missing in the code
Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .Cells.FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Okay we are getting somewhere! When I run the code and while watching the Summary page I see several header rows appear in cell A1 but only for a second until it is done running. Cell a1 contains "EXAM_DT_FUL" amd cell a2 contains "$S$1" Is it possible for not only the header rows, but actual data to be listed in the summary sheet? Thanks, Fred "Joel" wrote: Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address End With Set c = .Cells.FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: I was not sure were to put the code, but I tried it in several places and each time I received errors or it would not compile. Thanks Fred "Joel" wrote: from Set c = .FindNext(c) to Set c = .Cells.FindNext(c) "fgwiii" wrote: Hello, Sorry to be a pain, but I have made the changes but I am now getting a new error: Run-time error '438': object doesn't support this property or method. Just as an FYI - The date in my sheet covers columns A1 to R1 all the way down to row 30134. Thank you, Fred "Joel" wrote: You need to make two changes 1) change this line to match the sheet name you are working with With Sheets("Sheet1") 2) Add a worksheet named SUMMARY to your workbook. "fgwiii" wrote: Hello, When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
#12
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find and report
Joel,
Thank you very much - that did the trick! Your help is very much appreciated! Best regards Fred "Joel" wrote: Somehow an instruction is missing in the code Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .Cells.FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Okay we are getting somewhere! When I run the code and while watching the Summary page I see several header rows appear in cell A1 but only for a second until it is done running. Cell a1 contains "EXAM_DT_FUL" amd cell a2 contains "$S$1" Is it possible for not only the header rows, but actual data to be listed in the summary sheet? Thanks, Fred "Joel" wrote: Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address End With Set c = .Cells.FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: I was not sure were to put the code, but I tried it in several places and each time I received errors or it would not compile. Thanks Fred "Joel" wrote: from Set c = .FindNext(c) to Set c = .Cells.FindNext(c) "fgwiii" wrote: Hello, Sorry to be a pain, but I have made the changes but I am now getting a new error: Run-time error '438': object doesn't support this property or method. Just as an FYI - The date in my sheet covers columns A1 to R1 all the way down to row 30134. Thank you, Fred "Joel" wrote: You need to make two changes 1) change this line to match the sheet name you are working with With Sheets("Sheet1") 2) Add a worksheet named SUMMARY to your workbook. "fgwiii" wrote: Hello, When I attempt to run this, I get an Run-time error'9': Subscript out of range. Not being sure what to do, I clicked on sheet 2 and then right clicked, view code, and then pasted the code and ran it (as a macro). Thanks for your help! Fred "Joel" wrote: Create a worksheet Summary and change the worksheet name that you are searching in the code below Sub MakeReport() RowCount = 1 With Sheets("Sheet1") Set c = .Cells.Find(what:="m", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do With Sheets("Summary") .Range("A" & RowCount) = c.Value .Range("B" & RowCount) = c.Address RowCount = RowCount + 1 End With Set c = .FindNext(after:=c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub "fgwiii" wrote: Good morning, I am trying to find a way to search a spreadsheet that contains several hundreds of thousands of dates. Searching isn't really the problem, reporting however is the issue. What I would like is, to be able to search all of the cells in a worksheet for a letter such as €śm€ť and then automatically produce a report (worksheet) that contains all of the values that match that criteria as well as referencing the header/column letter where the cell was found. Thank you for your help, Fred |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find and report matching numbers in two worksheets | Excel Discussion (Misc queries) | |||
Can't find Report Manager in XP | Excel Discussion (Misc queries) | |||
find instances & report neighboring values | Excel Discussion (Misc queries) | |||
Where do I find Report Manager for Excel 2003? | Excel Discussion (Misc queries) | |||
Where can I find a template for application report specifications. | Excel Discussion (Misc queries) |