Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Looping on Cells with $x$y

Hello. I would like to utilize your expertise again. Is there a way to to
loop through cells that have the form "$B$2", such as "$Bi$j", where i and j
are integers. Is this possible? Is so how, because I tried with i and j type
looping. Thanks again.

D. Parker
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Looping on Cells with $x$y

"D.Parker" wrote:
Hello. I would like to utilize your expertise again. Is there a way to to
loop through cells that have the form "$B$2", such as "$Bi$j", where i and j
are integers.


$Bi$j could be $B2$3, which isn't a well-formed cell address.

What exactly is it that you want to do? There may be ways do what you need
without resorting to building cell addresses out of strings.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Looping on Cells with $x$y

$B$2 is a single cell. What is there to loop through. Unless you mean the
range bounded by A1 and B2. if that is the case then

dim rngToSearch as range
dim rngCurrent as range

set rngToSearch = range(activesheet("A1"), activesheet("B2"))
for each rngcurrent in rngToSearch
msgbox rngCurrent.address

next rngCurrent

"D.Parker" wrote:

Hello. I would like to utilize your expertise again. Is there a way to to
loop through cells that have the form "$B$2", such as "$Bi$j", where i and j
are integers. Is this possible? Is so how, because I tried with i and j type
looping. Thanks again.

D. Parker

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Looping on Cells with $x$y

You can form a cell address by using....

Range("B" & i)

or.......

Range("B" & i & ":B" & j )

but I think you must agree it is messy and difficult to read, also iterating
the columns is also messy. You can use.....

Cells(r1, c1)

for single cells or .....

Range(Cells(r1, c1), Cells(r2, c2))

for a range. These allow you to loop through using the variables
r1,c1,r2,c2 as required. Row first, Column second

--
Cheers
Nigel



"D.Parker" wrote in message
...
Hello. I would like to utilize your expertise again. Is there a way to

to
loop through cells that have the form "$B$2", such as "$Bi$j", where i and

j
are integers. Is this possible? Is so how, because I tried with i and j

type
looping. Thanks again.

D. Parker



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Looping on Cells with $x$y

In itself a cell is not absolute ($B$1) or relative (B1), or any combination
thereof. It can contain a formula or a function that uses one of those modes
of addressing, but it could even contain more than one mode, or even all 4.

What specifically are you trying to do?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"D.Parker" wrote in message
...
Hello. I would like to utilize your expertise again. Is there a way to

to
loop through cells that have the form "$B$2", such as "$Bi$j", where i and

j
are integers. Is this possible? Is so how, because I tried with i and j

type
looping. Thanks again.

D. Parker



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
reference cells when looping Isis[_2_] Excel Discussion (Misc queries) 5 April 29th 10 11:43 PM
Looping thru a range of cells COBOL Dinosaur New Users to Excel 9 June 2nd 07 03:41 AM
Looping through Cells Gary Paris[_2_] Excel Programming 5 December 25th 04 08:46 PM
Looping through a range of cells rEN Excel Programming 4 June 10th 04 06:28 PM
Looping thru cells in a named range Michael Beckinsale Excel Programming 4 September 2nd 03 02:07 PM


All times are GMT +1. The time now is 04:02 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"