ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Interaction between worksheets (https://www.excelbanter.com/excel-programming/318083-interaction-between-worksheets.html)

Teresa

Interaction between worksheets
 
The Combo is in the Summary Worksheet,
and the other sheets:DC,Time,Sheet3
should react when user clicks, clearly there is something
missing in my code, thanks in advance


Public Sub ComboBox1_Click()
Call filt
End Sub




Public Sub filt()

If Worksheets("Summary").ComboBox1.Value = "Qual" Then
Worksheets("DC").Range("Letters").ShowAllData
Worksheets("DC").Range("Letters").AutoFilter Field:=2, Criteria1:="Qual"
Range("a3").EntireRow.Hidden = True
Worksheets("Time").Range("A1:B50").Clear
Worksheets("Sheet3").Range("a1:b17").Copy
Destination:=Worksheets("Time").Range("a2")
Else
If Worksheets("Summary").ComboBox1.Value = "Quant" Then
Worksheets("DC").Range("Letters").ShowAllData
Worksheets("DC").Range("Letters").AutoFilter Field:=1, Criteria1:="Quant"
Range("a3").EntireRow.Hidden = True
Else
If Worksheets("Summary").ComboBox1.Value = "Both" Then
Worksheets("DC").Range("Letters").ShowAllData
Range("a3").EntireRow.Hidden = True
Worksheets("Time").Range("A1:B50").Clear
Worksheets("Sheet3").Range("a1:b31").Copy
Destination:=Worksheets("Time").Range("a2")
End If
End If
End If
End Sub

Paul Robinson

Interaction between worksheets
 
Hi Teresa
What is the code supposed to do? What does it do?? If an error is
generated, what is it and which line does it occur on??? Since you
have not said what your
If you can provide that info, then people have some chance of dealing
with your "clearly" bit!
regards
Paul
By the way, have you tried fully qualifying your range references?
What sheet is Range("a3") on for example?

teresa wrote in message ...
The Combo is in the Summary Worksheet,
and the other sheets:DC,Time,Sheet3
should react when user clicks, clearly there is something
missing in my code, thanks in advance


Public Sub ComboBox1_Click()
Call filt
End Sub




Public Sub filt()

If Worksheets("Summary").ComboBox1.Value = "Qual" Then
Worksheets("DC").Range("Letters").ShowAllData
Worksheets("DC").Range("Letters").AutoFilter Field:=2, Criteria1:="Qual"
Range("a3").EntireRow.Hidden = True
Worksheets("Time").Range("A1:B50").Clear
Worksheets("Sheet3").Range("a1:b17").Copy
Destination:=Worksheets("Time").Range("a2")
Else
If Worksheets("Summary").ComboBox1.Value = "Quant" Then
Worksheets("DC").Range("Letters").ShowAllData
Worksheets("DC").Range("Letters").AutoFilter Field:=1, Criteria1:="Quant"
Range("a3").EntireRow.Hidden = True
Else
If Worksheets("Summary").ComboBox1.Value = "Both" Then
Worksheets("DC").Range("Letters").ShowAllData
Range("a3").EntireRow.Hidden = True
Worksheets("Time").Range("A1:B50").Clear
Worksheets("Sheet3").Range("a1:b31").Copy
Destination:=Worksheets("Time").Range("a2")
End If
End If
End If
End Sub



All times are GMT +1. The time now is 05:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com