Open and Filter Folder

i_stoeva

New Member
Joined
Jun 7, 2006
Messages
29
Hi all,

could some one help me with this project....I have a command button which I want when being clicked to open a folder situating on this path: \\Server\Chef\Fakturi\Donau\2006

For this part i tired the following code, but it gives me an error:

Code:
Private Sub CommandButton1_Click()
Status = Shell("Explorer.exe /n, /n, " & "\\Server\Chef\Fakturi\Donau\2006 ", vbMaximizedFocus)
End Sub

saying that variable not defined, and when I use it on other pc in works...Where could be the problem?

And second question....when i make this command button works how to tell it, when opens the folder to filter only those files which are equal to the value of cell B3...

Is this possible by the way?

Thanks you,
Iva
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

dave3009

Well-known Member
Joined
Jun 23, 2006
Messages
7,002
Office Version
  1. 365
  2. 2016
Can't help you with the first bit but the second might work like this

Code:
Sub Filtering()
a = Sheets("Sheet3").Range("B3").Value
    Selection.AutoFilter
    Selection.AutoFilter Field:=2, Criteria1:=a
End Sub


Making the necessary alterations to suit your book

HTH


Dave
 

dave3009

Well-known Member
Joined
Jun 23, 2006
Messages
7,002
Office Version
  1. 365
  2. 2016
The issue with the first part might be a version issue. Do you use the same version of Excel at work on all PC's

I tried your code and it worked fine (other than I didn't have that file) I run Excel 2003 perhaps your work has 97 running on some of it's PC's and 2003 on others


Dave
 

i_stoeva

New Member
Joined
Jun 7, 2006
Messages
29
No, on both PC's is Excel 2003...I make the files on my PC and transfer them to the other, but both are with excel 2003. I checked also the VBA Preferences - and they are the same....This is a big puzzle for me...
 

Watch MrExcel Video

Forum statistics

Threads
1,108,627
Messages
5,523,985
Members
409,551
Latest member
WillCaton

This Week's Hot Topics

Top