[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Vb help

Posted on 2012-09-13
6
Medium Priority
?
469 Views
Last Modified: 2012-09-16
Please can you help,

I was hoping to amend the two command buttons so that they filter the page based on the dates held in B2:B3

At the moment it uses the filter function, but I was hoping to remove this. I just want to display the dates which fall between B2:B3 in column B
help3.xls
0
Comment
Question by:Kiwi-123
  • 4
6 Comments
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 38396906
If a date is to be removed, do you want to preserve the row it's in, or can that row be deleted?
0
 

Author Comment

by:Kiwi-123
ID: 38396962
I would like to preserve the row, or hide it.

Thanks,

Gaz
0
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 38397034
What is it that the filter function is doing that you don't want done?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Assisted Solution

by:Gerry Bartley
Gerry Bartley earned 400 total points
ID: 38398054
Add visibledropdown:=False

wks.Range("$B$9:$B$1000").AutoFilter Field:=1, _
        Criteria1:=">=" & Format(wks.Range("B2").Value, "mm/dd/yyyy"), _
        Operator:=xlAnd, _
        Criteria2:="<" & Format(wks.Range("B3").Value + 1, "mm/dd/yyyy"), visibledropdown:=False
0
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 38400717
Get rid of the named arguments; the named argument for VisibleDropDown did not seem to be acknowledged, but positional arguments work in this case:

   

wks.Range("$B$9:$B$1000").AutoFilter 1, _
        ">=" & Format(wks.Range("B2").Value, "mm/dd/yyyy"), _
        xlAnd, _
        "<" & Format(wks.Range("B3").Value + 1, "mm/dd/yyyy"), _
        False

Open in new window

0
 
LVL 23

Accepted Solution

by:
Christopher Kile earned 1600 total points
ID: 38400721
Note: I tested this with your worksheet:
help3.xls
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question