Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Loop until" syntax question
Hi, I am after help for the following: Range("TotalCentralregion").Select ' Range is a single cell Selection.Offset(1, 0).Select Selection.Formula = "=(" & ActiveCell.Offset(0, -2).Address & " /EastTotal)" What I need to do is loop this formula down a column until it gets to a single cell that has been named "TotalEastRegion". (Formula has to include "TotaleastRegion). Thanks for the help in advance. Fastbike -- Fastbike ------------------------------------------------------------------------ Fastbike's Profile: http://www.excelforum.com/member.php...o&userid=26701 View this thread: http://www.excelforum.com/showthread...hreadid=401530 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Loop until" syntax question
This really isn't a need to do any looping (or selecting):
Sub demo() With Range(Range("TotalCentralRegion").Offset(1), "TotalEastRegion") .FormulaR1C1 = "=RC[-2]/EastTotal" End With End Sub -- Jim "Fastbike" wrote in message ... Hi, I am after help for the following: Range("TotalCentralregion").Select ' Range is a single cell Selection.Offset(1, 0).Select Selection.Formula = "=(" & ActiveCell.Offset(0, -2).Address & " /EastTotal)" What I need to do is loop this formula down a column until it gets to a single cell that has been named "TotalEastRegion". (Formula has to include "TotaleastRegion). Thanks for the help in advance. Fastbike -- Fastbike ------------------------------------------------------------------------ Fastbike's Profile: http://www.excelforum.com/member.php...o&userid=26701 View this thread: http://www.excelforum.com/showthread...hreadid=401530 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Loop until" syntax question
The easiest way is to create a Range which is all of the cells between the
two named ranges and then ust traverse those cells... Kind of like this dim rngToSearch as Range dim rngCurrent as range set rngToSearch = range(Range("TotalCentralregion"), Range("TotalEastregion")) for each rngCurrent in rngToSearch 'rngCurrent is just like the active cell rngCurrent.Formula = "=(" & rngCurrent.Offset(0, -2).Address & "/EastTotal)" next rngCurrent -- HTH... Jim Thomlinson "Fastbike" wrote: Hi, I am after help for the following: Range("TotalCentralregion").Select ' Range is a single cell Selection.Offset(1, 0).Select Selection.Formula = "=(" & ActiveCell.Offset(0, -2).Address & " /EastTotal)" What I need to do is loop this formula down a column until it gets to a single cell that has been named "TotalEastRegion". (Formula has to include "TotaleastRegion). Thanks for the help in advance. Fastbike -- Fastbike ------------------------------------------------------------------------ Fastbike's Profile: http://www.excelforum.com/member.php...o&userid=26701 View this thread: http://www.excelforum.com/showthread...hreadid=401530 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Loop until" syntax question
Range("TotalCentralregion").select Do Selection.(1, 0).Formula = "=(" & ActiveCell.Offset(0, -2).Address & "/EastTotal)" ACtivecell.Offset(1.0).select Loop Until Activecell.value like "*TotalEastRegion*" -- HTH RP (remove nothere from the email address if mailing direct) "Fastbike" wrote in message ... Hi, I am after help for the following: Range("TotalCentralregion").Select ' Range is a single cell Selection.Offset(1, 0).Select Selection.Formula = "=(" & ActiveCell.Offset(0, -2).Address & " /EastTotal)" What I need to do is loop this formula down a column until it gets to a single cell that has been named "TotalEastRegion". (Formula has to include "TotaleastRegion). Thanks for the help in advance. Fastbike -- Fastbike ------------------------------------------------------------------------ Fastbike's Profile: http://www.excelforum.com/member.php...o&userid=26701 View this thread: http://www.excelforum.com/showthread...hreadid=401530 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Loop until" syntax question
Hi, thanks for all the replies. Much appreciated. -- Fastbike ------------------------------------------------------------------------ Fastbike's Profile: http://www.excelforum.com/member.php...o&userid=26701 View this thread: http://www.excelforum.com/showthread...hreadid=401530 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
correct syntax for nesting "if", "and", and "vlookup"....if possib | Excel Worksheet Functions | |||
"Disk is Full" add-on question to "Can't reset last cell" post tod | Excel Discussion (Misc queries) | |||
Syntax to "OR" 3 "ISERROR" conditions | Excel Worksheet Functions | |||
disregard 12/19/05 ".XValues syntax problem" question. Answer fou | Charts and Charting in Excel | |||
what is syntax for if(between range of dates,"Q1","Q2")? | Excel Worksheet Functions |