Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do you use a variable to determine a range when changing properties in VBA?
I am setting up code for a spread sheet so that I use a loop to test a respective cell in every row and every five or so columns. Then the way in which that value compares to other values on the spreadsheet, determines differnent cell properties for a different range of cells. (ie. font, font color, fill color) As the row and columns switch for the cell Im testing they also switch for the Range that I want to edit the properties. The Row value is the same for both of those but the column of the cell is different than the column values for the Range. I have variabes declared for both the stat column and end column of the range but how do I set it up so that I can use variables to edit the range properties. I have tried Worksheets"Sheet1".Range("A1").Font.Color Index=3, and that will do it but you can't replace the A1 with variables. I also tried Worksheets"Sheet1".Cells(x,y).Font.Color Index=3 but that only works for an inividual cell not a range. Please Help, Thanks, Scott |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variable Range | Excel Discussion (Misc queries) | |||
How to use a variable for a range | Excel Worksheet Functions | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
Using Variable in RANGE | Excel Programming | |||
Problem trying to us a range variable as an array variable | Excel Programming |