Posts

Showing posts with the label copy-paste

VBA Sumifs to paste result as values

Image
Clash Royale CLAN TAG #URR8PPP VBA Sumifs to paste result as values Would like to know how to code properly a SUMIFS formula and paste the results as value only. Is it also possible to just have the formula loop only on blank cells? I tried running the code and it seems that is pastes the formula for all cells. I've attached a sample code which I only got from other forums for reference. Would really appreciate your help guys! Option Explicit Sub SumGroups() Dim lastCode As Long, lastFiltCode As Long 'Determine Last Row in Column O (Unfiltered Codes) With Worksheets("Database") lastCode = .Range("O" & .Rows.Count).End(xlUp).Row End With With Worksheets("Sheet3") 'Determine last Row in Column A (Filtered Codes) lastFiltCode = .Range("A" & .Rows.Count).End(xlUp).Row .Range("B2:K" & lastFiltCode).Formula = _ "=SUMIFS(Database!$M$2:$M$" & l...