LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Looping through all cells in a workbook

I have a function (call it "ProcessRange") that works on a range that is
passed into it. It is called one of two ways: 1) the currently selected
cell range is passed in or 2) all cells on the sheet are passed in using
the sheet's .UsedRange property.

I want to be able to work with all cells from ALL Sheets in the workbook. I
know I can go through each sheet in the workbook and pass in that sheet's
UsedRange, however, I would like to only have to call my "ProcessRange". For
example, I have to call my method several times

Dim sheet As Worksheet

For Each sheet In Application.ActiveWorkbook.Sheets()
Debug.Print "Calculating Sheet: " & sheet.name
Call ProcessRange(sheet.UsedRange)
Next sheet

I would like to append the ranges from all cells together into ONE dynamic
range and then call ProcessRange once. Is this possible?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping though sheets in workbook KHogwood-Thompson Excel Programming 3 August 15th 08 04:10 PM
Looping through workbook bpotter Excel Programming 6 October 4th 06 06:39 PM
Looping a column in workbook 1 to workbook 2's sheets L. Howard Kittle Excel Programming 6 March 15th 06 03:14 PM
Workbook looping to many worksheets L. Howard Kittle Excel Programming 3 March 14th 06 09:03 PM
Looping worksheets in workbook Wylie C Excel Programming 2 March 18th 05 08:04 PM


All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"