Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching range for value (code written but needs 'tweaking'!)
Hi,
I've got a code that searches a range and changes the color of any cells with a value greater than 10,000. Unfortunately, this figure of 10,000 is often subject to changes and as such I have been trying unsuccessfully to modify the code to include a message that pops up on screen which will prompt the user (me) to enter the value to identify and apply the rest of the code to (ie identify and color all cells above the user entered value). I have included the code i'm currently using below, can anyone help me to modify it as desired? Manythanks in advance, Ian Sub ColorCells() Dim rgSales As Range Dim i As Long, j As Long Set rgSales = Range("A1:D6") For i = 1 To rgSales.Rows.Count For j = 1 To rgSales.Columns.Count If rgSales.Cells(i, j).Value < 10000 Then rgSales.Cells(i, j).Font.ColorIndex = 1 Else rgSales.Cells(i, j).Font.ColorIndex = 3 End If Next j Next i End Sub --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Searching Multiple Timesheets for a project code and then.... | Excel Worksheet Functions | |||
VBA code to searching for a folder | Excel Discussion (Misc queries) | |||
searching by number or code ina work book | Excel Discussion (Misc queries) | |||
Searching for VB Code to Link to Program | Excel Programming | |||
How to protect single cell or cells range from being over-written? | Excel Programming |