Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Using UsedRange as limits in a For Each loop but for cells on another sheet ?

Excel 2000 VBA.

How could I modify something like

For Each MyCell In MySheet.UsedRange
-stuff
Next

So that during the loop MyCell points to a cell in a sheet other than
MySheet but in the same row, col position on the other sheet. I want to
set-up a grid of formla on a new sheet (my code to do this is where -stuff
is). Each cell of my grid will reference it's counterpart in MySheet, but I
will not know how much data MySheet will have on t until it is used at run
time.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Using UsedRange as limits in a For Each loop but for cells on another sheet ?

The following code places a formula in each cell in Sheet2 that has a corresponding value in Sheet1, referring to that value:

For Each oCell In Sheet1.UsedRange
Sheet2.Range(oCell.Address) = "=" & oCell.Address(External:=True)
Next oCell


--

John Green - Excel MVP
Sydney
Australia


"tur13o" wrote in message ...
Excel 2000 VBA.

How could I modify something like

For Each MyCell In MySheet.UsedRange
-stuff
Next

So that during the loop MyCell points to a cell in a sheet other than
MySheet but in the same row, col position on the other sheet. I want to
set-up a grid of formla on a new sheet (my code to do this is where -stuff
is). Each cell of my grid will reference it's counterpart in MySheet, but I
will not know how much data MySheet will have on t until it is used at run
time.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Using UsedRange as limits in a For Each loop but for cells on another sheet ?

Star!

"John Green" wrote in message
...
The following code places a formula in each cell in Sheet2 that has a

corresponding value in Sheet1, referring to that value:

For Each oCell In Sheet1.UsedRange
Sheet2.Range(oCell.Address) = "=" & oCell.Address(External:=True)
Next oCell


--

John Green - Excel MVP
Sydney
Australia


"tur13o" wrote in message

...
Excel 2000 VBA.

How could I modify something like

For Each MyCell In MySheet.UsedRange
-stuff
Next

So that during the loop MyCell points to a cell in a sheet other than
MySheet but in the same row, col position on the other sheet. I want to
set-up a grid of formla on a new sheet (my code to do this is

where -stuff
is). Each cell of my grid will reference it's counterpart in MySheet,

but I
will not know how much data MySheet will have on t until it is used at

run
time.







Reply
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
Cross-sheet dependencies (smart recalc limits) Thinqer Excel Discussion (Misc queries) 0 March 29th 10 10:41 AM
SUM 3D Reference using variable sheet limits Loge Excel Worksheet Functions 6 December 31st 08 08:14 AM
VLOOKUPS: Limits on # per sheet? Trey Excel Discussion (Misc queries) 2 March 16th 06 03:19 AM
UsedRange on blank sheet? mike lee Excel Programming 3 October 16th 03 12:25 AM
Excluding sheet in loop david Excel Programming 2 July 31st 03 03:18 AM


All times are GMT +1. The time now is 10:12 PM.

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"