I need to find the rows between certain numbers (given by the user) to show them on the screen so it can be printed.
For example: The user enters 104822000011 and 104822000020 as from and to values. Then I need to search in another worksheet for any numbers that are between these. The data in the worksheet comes from a database. I need to return all the data in the rows that are between the given numbers.
I have very little knowledge of VBA, so if this can be done with worksheet functions, that will be preferable. I have googled and tried some things, but none of them seemed easy to do or didn’t work. Can anybody help me out a little here?
Yes, you may do that by copying rows (which you don’t want) or VBA.
And I believe VBA is a good option.
But if the record number is strictly numeric and there are not much data to show, I have a stupid method of using a PivotTable.
You can add a pivotTable which reference to the datasheet. Then drag all fields to the row labels. Then for every field settings, in the layout select “Show item labels in tabular form” and remove all the subtotals. It should now look similar to the original data.
Then you can select anywhere on the record number and select “Label Filters ==> Between” on the Row Labels. And then input your from and to value.