#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default do loop

I need a Do Loop to perform the following:

Select Column H
Find "ZZZ Total"
From that Active Cell, move 10 columns to the right and one cell down
Insert Formula "=Active Cell -1"
Loop until Column H cell value = ""

Thanks for the Help!

Mary
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default do loop

dim c as range
for each c in activesheet.range("H:H")

if len(c.value)=0 then exit for
if c.value="ZZZ Total" then
c.offset(1,10).formula = "=" & c.address(false,false) & "-1"
end if

next c

--
Tim Williams
Palo Alto, CA


"Lost in Alabama" wrote in message
...
I need a Do Loop to perform the following:

Select Column H
Find "ZZZ Total"
From that Active Cell, move 10 columns to the right and one cell down
Insert Formula "=Active Cell -1"
Loop until Column H cell value = ""

Thanks for the Help!

Mary



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default do loop

Tim,

Thanks for the quick response. This works except I need the formula to be
the value contained in the cell one row up from the cell where the formula is.

Thanks,

Mary

"Tim Williams" wrote:

dim c as range
for each c in activesheet.range("H:H")

if len(c.value)=0 then exit for
if c.value="ZZZ Total" then
c.offset(1,10).formula = "=" & c.address(false,false) & "-1"
end if

next c

--
Tim Williams
Palo Alto, CA


"Lost in Alabama" wrote in message
...
I need a Do Loop to perform the following:

Select Column H
Find "ZZZ Total"
From that Active Cell, move 10 columns to the right and one cell down
Insert Formula "=Active Cell -1"
Loop until Column H cell value = ""

Thanks for the Help!

Mary




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default do loop

Assume

H15: ZZZ Total
R15: 100
R16: ??????

what do you want entered in R16
what do you want displayed in R16

--
Regards,
Tom Ogilvy


"Lost in Alabama" wrote in message
...
Tim,

Thanks for the quick response. This works except I need the formula to be
the value contained in the cell one row up from the cell where the formula

is.

Thanks,

Mary

"Tim Williams" wrote:

dim c as range
for each c in activesheet.range("H:H")

if len(c.value)=0 then exit for
if c.value="ZZZ Total" then
c.offset(1,10).formula = "=" & c.address(false,false) & "-1"
end if

next c

--
Tim Williams
Palo Alto, CA


"Lost in Alabama" wrote in

message
...
I need a Do Loop to perform the following:

Select Column H
Find "ZZZ Total"
From that Active Cell, move 10 columns to the right and one cell down
Insert Formula "=Active Cell -1"
Loop until Column H cell value = ""

Thanks for the Help!

Mary






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default do loop

Dim Cell As Range

For Each Cell In Range("H:H")
If Cell.Value = "ZZZ Total" Then
Cell.Offset(1, 10).Formula = "=" & Cell.Offset(-1, 0).Address(False,
False)
End If
Next Cell


"Lost in Alabama" wrote:

I need a Do Loop to perform the following:

Select Column H
Find "ZZZ Total"
From that Active Cell, move 10 columns to the right and one cell down
Insert Formula "=Active Cell -1"
Loop until Column H cell value = ""

Thanks for the Help!

Mary



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default do loop

Charile,

Thanks for the quick response. This works except I need the value contained
in the cell found in Column R to be one cell up in Column R.

Thanks,

Mary


"Charlie" wrote:

Dim Cell As Range

For Each Cell In Range("H:H")
If Cell.Value = "ZZZ Total" Then
Cell.Offset(1, 10).Formula = "=" & Cell.Offset(-1, 0).Address(False,
False)
End If
Next Cell


"Lost in Alabama" wrote:

I need a Do Loop to perform the following:

Select Column H
Find "ZZZ Total"
From that Active Cell, move 10 columns to the right and one cell down
Insert Formula "=Active Cell -1"
Loop until Column H cell value = ""

Thanks for the Help!

Mary

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default do loop

Thanks to both you and Tim,

The following works great.


Dim Cell As Range

For Each Cell In Range("H:H")
If Cell.Value = "ZZZTotal" Then
Cell.Offset(1, 10).Formula = "=" & Cell.Offset(0, 10).Address(False, False)
End If
Next Cell

You Guys are GREAT!!

Mary




"Lost in Alabama" wrote:

Charile,

Thanks for the quick response. This works except I need the value contained
in the cell found in Column R to be one cell up in Column R.

Thanks,

Mary


"Charlie" wrote:

Dim Cell As Range

For Each Cell In Range("H:H")
If Cell.Value = "ZZZ Total" Then
Cell.Offset(1, 10).Formula = "=" & Cell.Offset(-1, 0).Address(False,
False)
End If
Next Cell


"Lost in Alabama" wrote:

I need a Do Loop to perform the following:

Select Column H
Find "ZZZ Total"
From that Active Cell, move 10 columns to the right and one cell down
Insert Formula "=Active Cell -1"
Loop until Column H cell value = ""

Thanks for the Help!

Mary

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default do loop

you mean like this?

Cell.Offset(1, 10).Formula = "=" & Cell.Offset(0, 10).Address(False,
False)


"Lost in Alabama" wrote:

Charile,

Thanks for the quick response. This works except I need the value contained
in the cell found in Column R to be one cell up in Column R.

Thanks,

Mary


"Charlie" wrote:

Dim Cell As Range

For Each Cell In Range("H:H")
If Cell.Value = "ZZZ Total" Then
Cell.Offset(1, 10).Formula = "=" & Cell.Offset(-1, 0).Address(False,
False)
End If
Next Cell


"Lost in Alabama" wrote:

I need a Do Loop to perform the following:

Select Column H
Find "ZZZ Total"
From that Active Cell, move 10 columns to the right and one cell down
Insert Formula "=Active Cell -1"
Loop until Column H cell value = ""

Thanks for the Help!

Mary

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
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Loop Function unable to loop Junior728 Excel Programming 1 July 28th 05 10:23 AM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
For/Loop skipping one value in loop only Matt Jensen Excel Programming 6 January 8th 05 12:03 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


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