ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cycle through worksheets and sum (https://www.excelbanter.com/excel-programming/351215-cycle-through-worksheets-sum.html)

David M C

Cycle through worksheets and sum
 
I want to write some VBA to cycle through all worksheets in a workbook and
copies the value 4 cells across from the one that contains "Total" into Row B
of my totals workshets, and also the value in cell D10.

Ideas?

Thanks

Dave

Bob Phillips[_6_]

Cycle through worksheets and sum
 
To loop through all the worksheets

For Each sh In Activeworkbook.Worksheets
....
Next sh

To find "Total", look at the Find method in VBA help.

To offset by 4 cells, use

Offset(0,4)

The value in D10 can be addressed directly

Range("D10").Value

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"David M C" wrote in message
...
I want to write some VBA to cycle through all worksheets in a workbook and
copies the value 4 cells across from the one that contains "Total" into

Row B
of my totals workshets, and also the value in cell D10.

Ideas?

Thanks

Dave





All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com