Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a command button that runs code in order to assign a random number and save a workbook. I would like to add a step to this code so that it takes the number that is in WorkSheet Start cell D1, and uses that number in a data filter that is on another worksheet. The location of the filter is: APsheet cell E3, and I would like that to filter for anything that contains the number from Start D1.
Is this possible, or should I find another method? Thanks in advance! Paul |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Paul,
Am Sun, 10 Jul 2016 15:58:24 -0700 (PDT) schrieb Paul Doucette: I have a command button that runs code in order to assign a random number and save a workbook. I would like to add a step to this code so that it takes the number that is in WorkSheet ?Start? cell D1, and uses that number in a data filter that is on another worksheet. The location of the filter is: APsheet cell E3, and I would like that to filter for anything that ?contains? the number from Start D1. Is this possible, or should I find another method? are the values in column E text? Then you can try: Sub Filter() Dim crit As String Dim myRng As Range Dim LRow As Long crit = Sheets("Start").Range("D1") With Sheets("APsheet") LRow = .Cells(Rows.Count, "E").End(xlUp).Row .Range("E3:E" & LRow).AutoFilter Field:=5, Criteria1:="=*" & crit & "*" End With End Sub If the values in E are numbers they will be handled as numbers even if you format them as text and "contains" is not possible. Regards Claus B. -- Windows10 Office 2016 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sunday, July 10, 2016 at 6:58:29 PM UTC-4, Paul Doucette wrote:
I have a command button that runs code in order to assign a random number and save a workbook. I would like to add a step to this code so that it takes the number that is in WorkSheet Start cell D1, and uses that number in a data filter that is on another worksheet. The location of the filter is: APsheet cell E3, and I would like that to filter for anything that contains the number from Start D1. Is this possible, or should I find another method? Thanks in advance! Paul The values are text, and it works perfectly. I have been abusing your kindness, Claus! Thank you!!!! I hope you have a pleasant day (or evening... not sire of the time difference) Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Filter, Cell Reference formula and copy formula on filter data | Excel Programming | |||
DataFilterAuto Filter in excel 2007? | New Users to Excel | |||
Data - Filter - Auto Filter | Excel Discussion (Misc queries) | |||
in data/filter/auto filter | Excel Worksheet Functions | |||
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du | Excel Worksheet Functions |