R
ricowyder
Good morning,
I've created a special filter using 3 worksheets.
One worksheet contains all data (A1:H1500).
Name: NetRevAndPax
Second sheet should be the one, where the filtered range is pasted
(A1:G1, rows not defined).
Name: FiltNetRev
Third sheet is the one, where the filter criteria is entered (just one
customer ID number, E8:E9).
Name: CREATE
In this third sheet, I have written the Sub (it is not a module, but
the sub is in the worksheet):
Sub Worksheet_Change(ByVal Target As Range)
Dim rngDB As Range
Dim rngFilter As Range
Dim rngOutput As Range
Set rngDB = Worksheets("NetRevAndPax").Range("A1:H1500")
Set rngFilter = Worksheets("CREATE").Range("E8:E9")
Set rngOutput = Worksheets("FiltNetRev").Range("A1:H1")
If Not (Application.Intersect(rngFilter, Target) Is Nothing) Then
rngDB.AdvancedFilter _
Action:=xlFilterCopy, _
CriteriaRange:=rngFilter, _
CopyToRange:=rngOutput, _
Unique:=False
End If
Set rngDB = Nothing
Set rngFilter = Nothing
Set rngOutput = Nothing
End Sub
So far, everything works fine. When I enter the number, the data is
retrieved from one worksheet and copied in the other one (FiltNetRev).
However, my job is not done yet and I NEED YOUR HELP.
I want to be able to enter that number, but the job should not only be
done once (in worksheet NetRevandPax to FiltNetRev), but also from
several other worksheets (e.g. Data2 to Event02 and Data3 to Event3). I
have around 10 data sheets and would create around 10 event sheets,
where the filtered data should be copied in.
ALWAYS BASED ON THE SAME ENTRY I DO ONCE IN THE WORKSHEET "CREATE".
Maybe I have started wrong by putting the macro in the worksheet (not
in a module)
or
maybe I need to programm it completely new?
Please help! I need your help, because I cannot move ahead... Thanks to
anybody contributing to it.
Best regards,
Rico
I've created a special filter using 3 worksheets.
One worksheet contains all data (A1:H1500).
Name: NetRevAndPax
Second sheet should be the one, where the filtered range is pasted
(A1:G1, rows not defined).
Name: FiltNetRev
Third sheet is the one, where the filter criteria is entered (just one
customer ID number, E8:E9).
Name: CREATE
In this third sheet, I have written the Sub (it is not a module, but
the sub is in the worksheet):
Sub Worksheet_Change(ByVal Target As Range)
Dim rngDB As Range
Dim rngFilter As Range
Dim rngOutput As Range
Set rngDB = Worksheets("NetRevAndPax").Range("A1:H1500")
Set rngFilter = Worksheets("CREATE").Range("E8:E9")
Set rngOutput = Worksheets("FiltNetRev").Range("A1:H1")
If Not (Application.Intersect(rngFilter, Target) Is Nothing) Then
rngDB.AdvancedFilter _
Action:=xlFilterCopy, _
CriteriaRange:=rngFilter, _
CopyToRange:=rngOutput, _
Unique:=False
End If
Set rngDB = Nothing
Set rngFilter = Nothing
Set rngOutput = Nothing
End Sub
So far, everything works fine. When I enter the number, the data is
retrieved from one worksheet and copied in the other one (FiltNetRev).
However, my job is not done yet and I NEED YOUR HELP.
I want to be able to enter that number, but the job should not only be
done once (in worksheet NetRevandPax to FiltNetRev), but also from
several other worksheets (e.g. Data2 to Event02 and Data3 to Event3). I
have around 10 data sheets and would create around 10 event sheets,
where the filtered data should be copied in.
ALWAYS BASED ON THE SAME ENTRY I DO ONCE IN THE WORKSHEET "CREATE".
Maybe I have started wrong by putting the macro in the worksheet (not
in a module)
or
maybe I need to programm it completely new?
Please help! I need your help, because I cannot move ahead... Thanks to
anybody contributing to it.
Best regards,
Rico