? .... I didnt edit anything?
? .... I didnt edit anything?
OKay then, as per "Rule 9", here was my solution.
I had one workbook RUNNING the macro, and pasting the information into an "output" file. Here's what I wrote.
What ended up happening with that was that the file executing the code was autosumming the data in the range in that workbook instead of the range of the output file.![]()
Sub RVR_GMH_NonXIX() ' Subtotals RVR GMH Non-XIX values Range("a3").Select Selection.AutoFilter Selection.AutoFilter Field:=7, Criteria1:="GMH" Selection.AutoFilter Field:=6, Criteria1:="Non XIX" Dim b As Range ' create range in column N from row 2 to the last visible cell with data With Sheet1 Set b = .Range("N2", .Range("N" & .Rows.Count).End(xlUp)) End With Range("S1").Value = WorksheetFunction.Sum(b.SpecialCells(xlCellTypeVisible)) Range("S1").Select Selection.Copy Worksheets("Summary").Activate Range("E10").PasteSpecial Worksheets("RVR Detail").Activate Selection.AutoFilter End Sub
The problem was here:
Since I had "activated" the output file earlier in the code I changed the code to this:![]()
With Sheet1 Set b = .Range("N2", .Range("N" & .Rows.Count).End(xlUp)) End With
and Bob's your uncle.![]()
With ActiveSheet Set b = .Range("N2", .Range("N" & .Rows.Count).End(xlUp)) End With
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks