S
stevestr
My macro below needs some tweaking. The macro applies a filter and then
prints two copies of the sheet. My mistake is here:
If Range("D6").Value = "EDTAP: RLSS" Then
'call macro here
After the filter is applied, the first five rows is header information. I
wanted the Macro to look at the first row of filtered information for "EDTAP:
RLSS". What I didn't realize when writing this macro that the 6th row of my
data may not contain "EDTAP: RLSS". Instead the first row of filtered data
may have "EDTAP: RLSS" on the 13th row. If so, my macro does not print the
filtered data.
What I needed to do was to program the macro to look at the 6th line of data
after the filter has been applied, not row 6. How do I get the macro to do
just that?
Thanks,
************************************
Goes to Mileage form, applies filter
'
'
Sheets("Mileage and Expense Form").Select
ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=4, Criteria1:= _
"=EDTAP: RLSS", Operator:=xlOr, Criteria2:="="
' ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=4,
Criteria1:= _
"EDTAP: RLSS"
'
'
' Prints two copies of Filtered sheet.
'
If Range("D6").Value = "EDTAP: RLSS" Then
'call macro here
ExecuteExcel4Macro "PRINT(1,,,2,,,,,,,,2,,,TRUE,,FALSE)"
End If
'
' ExecuteExcel4Macro "PRINT(1,,,2,,,,,,,,2,,,TRUE,,FALSE)"
'
'
prints two copies of the sheet. My mistake is here:
If Range("D6").Value = "EDTAP: RLSS" Then
'call macro here
After the filter is applied, the first five rows is header information. I
wanted the Macro to look at the first row of filtered information for "EDTAP:
RLSS". What I didn't realize when writing this macro that the 6th row of my
data may not contain "EDTAP: RLSS". Instead the first row of filtered data
may have "EDTAP: RLSS" on the 13th row. If so, my macro does not print the
filtered data.
What I needed to do was to program the macro to look at the 6th line of data
after the filter has been applied, not row 6. How do I get the macro to do
just that?
Thanks,
************************************
Goes to Mileage form, applies filter
'
'
Sheets("Mileage and Expense Form").Select
ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=4, Criteria1:= _
"=EDTAP: RLSS", Operator:=xlOr, Criteria2:="="
' ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=4,
Criteria1:= _
"EDTAP: RLSS"
'
'
' Prints two copies of Filtered sheet.
'
If Range("D6").Value = "EDTAP: RLSS" Then
'call macro here
ExecuteExcel4Macro "PRINT(1,,,2,,,,,,,,2,,,TRUE,,FALSE)"
End If
'
' ExecuteExcel4Macro "PRINT(1,,,2,,,,,,,,2,,,TRUE,,FALSE)"
'
'