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: 64
Default How do I create a For loop within a For loop?

Hi - I'm trying to set up a loop which first selects a range within a sheet
and then changes each of the cells within the selected range. There are
multiple ranges within the sheet that I need to do this for -- below is my
attempt at this (I get an error saying "For control varialbe already in
use"). Any advice is much appreciated!

For Each c In Worksheets("Aurora").Range("A1:Z1500").Cells
If c.Value = "MAX PRICE AFTER ADJUSTMENTS:" Then Set myRange =
Range(c.Value, Selection.End(xlDown)).Select & Range(Selection,
Selection.End(xlToRight)).Select
For Each c In Worksheets("Aurora").myRange
Set c.Value = c.Value - 0.5
Next
 
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
Create a loop stephenc Excel Discussion (Misc queries) 4 January 12th 09 03:54 PM
Use a loop to create multiple Charts - Suggestions ? APOEL Charts and Charting in Excel 1 July 29th 06 03:36 AM
Loop through data for conditions and create a new sheet Mackay 1979 Excel Programming 3 September 6th 04 11:58 PM
Macro to move, create formulas and loop NewMacro Excel Programming 5 February 2nd 04 10:12 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 05: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"