Search, filter and populate spreadsheet

Bevilready

New Member
Joined
Mar 2, 2022
Messages
15
Office Version
  1. 2016
Platform
  1. Windows
Hello, I have a spreadsheet in which I would like to be able to use a search box to filter through a list of products and add a quantity to each item I search for. After which I'm would like the items I have put quantities against to appear in a separate list, which would become an order to send to my supplier. I have been able to create a search, but am not able to put a quantity in the cell which remains once the search is cleared.
Can anyone help me please?
Thanks,
Bevilready

1646230822703.png
 
Place this macro in a regular module and assign it to the "Re-Set" button.
VBA Code:
Sub ReSet()
    Range("A4").AutoFilter
    Range("P5", Range("X" & Rows.Count).End(xlUp)).ClearContents
End Sub
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi mumps, I've realised that after searching and adding a quantity to a product and it successfully appearing in the order form. If you repeat this process the second selection overwrites the first in the order form. It doesn't add the line beneath the first.
Would you be able to help please?
 
Upvote 0
Each time you add a quantity for an item, the data is copied to the first blank row in the order form so I'm not sure what you mean by:
If you repeat this process the second selection overwrites the first in the order form. It doesn't add the line beneath the first.
Please clarify in detail, step by step, using a few examples.
 
Upvote 0
Ignore me, I've been using the re-set button wrongly. I only need to press the re-set button when I've made all my selections.
I have found that the new script for the re-set button deletes the content from the headers on the order form though.
1646327507068.png


I would like to be able to clear the contents from the other table when I've placed the order.

1646327712380.png
 
Upvote 0
Please note that this line of code clears the data starting at P5 (row 5). The headers are in row 4 so they shouldn't be deleted.
VBA Code:
Range("P5", Range("X" & Rows.Count).End(xlUp)).ClearContents

Is the order considered placed when you click the "Re-Set" button? Do you want to clear all the data in columns C to G?
 
Upvote 0
Yes the order is considered placed when I click the Re-Set button. But I would like to clear the data in columns E to G
 
Upvote 0
Replace the previous macro with this one:
VBA Code:
Sub ReSet()
    Range("A4").AutoFilter
    Range("P5", Range("X" & Rows.Count).End(xlUp)).ClearContents
    Range("E5:G" & Range("A" & Rows.Count).End(xlUp).Row).ClearContents
End Sub
 
Upvote 0
I think I've broke it...... Would you be able to get it working again?
It doesn't add any lines to the order form now.

Bevilready.xlsmxfyal9dv51dg4l8hxsia
 
Upvote 0
When the data in the products chart are filtered, the data in the order chart are also filtered. This can't be avoided. Because some of the rows in the order chart are not visible, this creates problems for the macro when trying to paste the data in the first available row. The only way to fix this is to place the order data on a separate sheet. Click here for your file and give it a try.
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,986
Members
449,060
Latest member
mtsheetz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top