RWayneH
asked on
Sending a value to two places.
I use the following code to throw a value in cell D8 of the MDL - Summary sheet tab.
How would I edit this to throw the same value to another sheet tab cell? Say Sheet1, cell B9?
Please advise and thanks. -R-
How would I edit this to throw the same value to another sheet tab cell? Say Sheet1, cell B9?
Please advise and thanks. -R-
Sub MDL_GetCompletedOrdersTodayMinusOneDay()
'On Format tab only
Dim rgFilter As Range, rgTarg As Range
Set rgTarg = Worksheets("MDL - Summary").Range("D8") 'Record count goes here
Sheets("Format").Select
With Worksheets("Format") 'Worksheet to be filtered
Set rgFilter = .Range("A1") 'First header label in range to be filtered
Set rgFilter = Intersect(.UsedRange, rgFilter.Resize(1, 100).EntireColumn) 'All the rows of data
rgTarg.Formula = "=SUBTOTAL(3,'" & .Name & "'!" & rgFilter.Columns(3).Address & ")-1"
With rgFilter
.AutoFilter
.AutoFilter Field:=7, Criteria1:="SPCLMDL"
.AutoFilter Field:=10, Criteria1:="=CNF LKD REL", Operator:=xlOr, Criteria2:="=CNF REL"
.AutoFilter Field:=22, Operator:=xlFilterValues, Criteria2:=Array(2, Format(Date - 1, "m/d/yyyy"))
' .AutoFilter Field:=22, Operator:=xlFilterValues, Criteria2:=Array(2, Format(Date, "m/d/yyyy"))
rgTarg.Formula = rgTarg.Value
' .AutoFilter 'Turn filters off
End With
End With
Sheets("MDL - Summary").Select
' Range("C4").Select
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER