Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DarkSun (Programmer) Please Reply

Status
Not open for further replies.

missprogrammer

Programmer
Nov 7, 2000
20
US
Okay the situation is that I'm pull this information from an Olap Cube using MDX quering and VBA. The code is going through a loop and creating several worksheets within the workbook(Totaling 8 workbooks). This will be ran everyweek. The Clients wants to shade the blank cells red.

What type of conditional formating are you talking about, I have missed around with it a little, but its not doing what i wanted it to do so I stoped. It was selected not only the blank cells but the already shaded black cells also. Did I not use it correctly



I can not figure out how to select the last four columns on each sheet which as three sub divisions(ex.Women,Men, Children) each worksheet within the workbook.The code below stores the first column, but from there i want to select the next 3 column. Within the column i want to select the cells that are null and where the cell is not already black and turn red The code is pointing to the last column, that much is working. But what next I dont know.

If .cells(y - 1, x) <> &quot;Answer&quot; Then

blnStop = True
intCalcCol = x
 
Okay, here is some code that should help.

It is a sub that given a column number and number of rows will shade all cells that are empty and not black.

Private Sub Check()
Call ChangeColor(1, 10)
End Sub

Private Sub ChangeColor(MyCol As Integer, MaxRows As Long)
For i = 1 To MaxRows
If ActiveSheet.Cells(i, MyCol).Value = &quot;&quot; And ActiveSheet.Cells(i, MyCol).Interior.ColorIndex <> 1 Then
ActiveSheet.Cells(i, MyCol).Interior.ColorIndex = 3
End If
Next i
End Sub

Let me know if this doesn't help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top