Hi all. I've written a macro that iterates between several workbooks. Each workbook has a sheet with a data validation list with different "Views" as options. When selecting each view, the workbook automatically hides and unhides columns. All i need to do is, go through every view and get the sum of all cells in the sheet. The macro selects all the cells for both views correctly, but the sum of View1 is equal to sum of View2, where these should be different.
Here's the code I have:
Any help? Thanks!
Here's the code I have:
Code:
[COLOR=#333333][FONT=Segoe UI]wbkWorksheets("Sheet1").Activate[/FONT][/COLOR][COLOR=#333333][FONT=Segoe UI]
'Get data from View1 Sheet1 by selecting all cells, then unselect
Cells.Select
View1Sheet1 = WorksheetFunction.sum(Selection)
Range("A1").Select
'Get data from View2 Sheet1 by selecting all cells, then unselect
Application.CutCopyMode = False
Range("H8").Value = "View2"
Range("A1").Select
Cells.Select
Range("A1").Select
View2Sheet1 = WorksheetFunction.sum(Selection)[/FONT][/COLOR]
Any help? Thanks!