Home Adding a range of cells from 2 worksheets
Reply: 0

Adding a range of cells from 2 worksheets

user1009 Published in July 20, 2018, 1:07 am

I have a working code that allows me to add all sheets in a folder and pivot tables summing up an inventory form. I've now been tasked with trying to create a running total page where we can take a second worksheet and just add or subtract how many items are entered in the total row. I've pieced together this code which works to an extent of what I need.

Dim Add As Integer
Dim var1 As Integer
Dim var2 As Integer
var1 = Worksheets("Sheet1").Range("D6").Value
var2 = Worksheets("add").Range("F6").Value
Add = var1 + var2
ActiveCell.FormulaR1C1 = Add
Application.DisplayAlerts = False

This however only works for a single cell and I need it to work for a range from D4 to D649 on Sheet1. I can't for the life of me think of the solution to this and I can't seem to find the solution in reference to multiple sheets and multiple cells.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.302942 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO