Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Drop down boxes in VBA

Hi

I have two different drop down boxes on two different sheets. I want to make
a macro that will automatically change the second drop down box when someone
manually updates the first drop down box. I am currently using the code below
but it only works for the first person ("Adrienne Zwarts"). Can anyone help
me?

Sub Adviser()

Dim Adviser(2) As String
Dim i As Integer
Dim var

Adviser(0) = "Adrienne Zwarts"
Adviser(1) = "Andrew Cuttriss"
Adviser(2) = "Anna Tapp"

Sheets("Cover Letter").Select
If Range("D22") = Adviser(i) Then
Sheets("Nov09").Select
Selection.AutoFilter Field:=2, Criteria1:=Adviser(i)


End If

End Sub

P.S. I'm very new to this
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Drop down boxes in VBA

Modify this:

If Range("D22") = Adviser(i) Then
Sheets("Nov09").Select
Selection.AutoFilter Field:=2, Criteria1:=Adviser(i)

End If

To this:

For i = 0 To 2
If Range("D22") = Adviser(i) Then
Sheets("Nov09").Select
Selection.AutoFilter Field:=2, Criteria1:=Adviser(i)
End If
Next

But it will still only match one of the three names. Why don't you explain
what you are trying to do and maybe someone can give you a solution that
will use all three names.






"Haden" wrote in message
...
Hi

I have two different drop down boxes on two different sheets. I want to
make
a macro that will automatically change the second drop down box when
someone
manually updates the first drop down box. I am currently using the code
below
but it only works for the first person ("Adrienne Zwarts"). Can anyone
help
me?

Sub Adviser()

Dim Adviser(2) As String
Dim i As Integer
Dim var

Adviser(0) = "Adrienne Zwarts"
Adviser(1) = "Andrew Cuttriss"
Adviser(2) = "Anna Tapp"

Sheets("Cover Letter").Select
If Range("D22") = Adviser(i) Then
Sheets("Nov09").Select
Selection.AutoFilter Field:=2, Criteria1:=Adviser(i)


End If

End Sub

P.S. I'm very new to this



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop-down boxes KRK New Users to Excel 2 July 11th 09 11:14 PM
Drop down boxes BJS Excel Discussion (Misc queries) 1 December 16th 08 08:39 PM
Drop down boxes/tick boxes Jane Excel Worksheet Functions 2 October 28th 08 04:02 PM
drop down boxes april Excel Discussion (Misc queries) 2 April 19th 07 10:11 PM
Drop Down boxes MaBell Excel Programming 1 December 13th 04 04:08 PM


All times are GMT +1. The time now is 10:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"