Click here to Skip to main content
15,914,409 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: About JavaReg. Pin
Sairam Samavedam4-Feb-04 8:35
Sairam Samavedam4-Feb-04 8:35 
GeneralRe: About JavaReg. Pin
Dave Kreskowiak4-Feb-04 8:41
mveDave Kreskowiak4-Feb-04 8:41 
GeneralRe: About JavaReg. Pin
Sairam Samavedam4-Feb-04 8:45
Sairam Samavedam4-Feb-04 8:45 
GeneralRe: About JavaReg. Pin
Dave Kreskowiak6-Feb-04 3:26
mveDave Kreskowiak6-Feb-04 3:26 
GeneralSetting the Default file name in the SaveFileAs Dialog from VB.Net Pin
nvmoss3-Feb-04 7:47
nvmoss3-Feb-04 7:47 
GeneralSetting Default filename in Excel fileSaveAs Dialog Pin
nvmoss3-Feb-04 2:33
nvmoss3-Feb-04 2:33 
GeneralRe: Setting Default filename in Excel fileSaveAs Dialog Pin
John Kuhn3-Feb-04 12:28
John Kuhn3-Feb-04 12:28 
GeneralMore VB and Excel (Groan!) Pin
RichardGrimmer3-Feb-04 2:13
RichardGrimmer3-Feb-04 2:13 
Hi guys (again!)

Some of you may have been folowing my escapades with the Excel Object model, and many thanks to those that have offered assistance!

So today's problem is as follows....

Have a column containing dates (Action dates). Each value in the column can be in either one of three states based on the values in two other date cols( Start date and End date). The values can either be accepted - i.e. between the two other dates, and therefore green, Not accepted, i.e. outside the dates and therefore Red, or Default - a value read from a SProc in an SQLServer db, and hence Blue.

Now using conditional formatting, can use xlCellValue type, and compare based on the two cols for Accepted / Not accepted, and this seems to be OK, however, I cannot seem to make it work for the default values. I'm using the following code:

<br />
    strCondString = "=$I$" & CStr(lPos) & "=" & dtDefault<br />
    <br />
    With oWS.Cells(lPos, "I").FormatConditions.Add _<br />
                (Type:=xlExpression, Formula1:=strCondString)<br />
<br />
        With .Font<br />
            .Color = RGB(0, 0, 255)<br />
            .Bold = True<br />
        End With<br />
<br />
    End With<br />


where lPos is a row reference, and dtDefault is the date. strCondString will evaluate to something like "=$I$2=12/01/2004"

The code seems to get through the compiler, in that it doesn't throw any errors when steppping over, but also doesn't colour the text at all - it stays black.....anyone?

To add confusion (and not looked at this bit yet), how will it all stack up when I throw in the colouring for Accepted - all default dates will be "accepted", so is there any precedence in the FormatConditions that anyone knows about?



"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
GeneralRe: More VB and Excel (Groan!) Pin
John Kuhn4-Feb-04 8:29
John Kuhn4-Feb-04 8:29 
GeneralRe: More VB and Excel (Groan!) Pin
RichardGrimmer4-Feb-04 22:03
RichardGrimmer4-Feb-04 22:03 
GeneralRe: More VB and Excel (Groan!) Pin
Steve S9-Feb-04 7:18
Steve S9-Feb-04 7:18 
GeneralSetting value of Combo...People with more white brain cells suggested to view this,,,, Pin
Het21093-Feb-04 1:19
Het21093-Feb-04 1:19 
GeneralRe: Setting value of Combo...People with more white brain cells suggested to view this,,,, Pin
RichardGrimmer4-Feb-04 22:05
RichardGrimmer4-Feb-04 22:05 
GeneralRe: Setting value of Combo...People with more white brain cells suggested to view this,,,, Pin
Het21095-Feb-04 1:36
Het21095-Feb-04 1:36 
GeneralRe: Setting value of Combo...People with more white brain cells suggested to view this,,,, Pin
RichardGrimmer5-Feb-04 1:41
RichardGrimmer5-Feb-04 1:41 
GeneralCollection Objects Pin
Roozbeh693-Feb-04 0:16
professionalRoozbeh693-Feb-04 0:16 
GeneralRe: Collection Objects Pin
John Kuhn3-Feb-04 13:17
John Kuhn3-Feb-04 13:17 
GeneralAccess shared folder Pin
radhika812-Feb-04 19:33
radhika812-Feb-04 19:33 
GeneralRe: Access shared folder Pin
John Kuhn3-Feb-04 12:17
John Kuhn3-Feb-04 12:17 
GeneralRe: Access shared folder Pin
Anonymous5-Feb-04 18:43
Anonymous5-Feb-04 18:43 
GeneralRe: Access shared folder Pin
John Kuhn5-Feb-04 18:57
John Kuhn5-Feb-04 18:57 
GeneralDirectDraw in VB.NET Pin
PC3700DDR2-Feb-04 16:04
PC3700DDR2-Feb-04 16:04 
GeneralI NEED HELP..NEED A GURU Pin
Anonymous2-Feb-04 15:15
Anonymous2-Feb-04 15:15 
GeneralRe: I NEED HELP..NEED A GURU Pin
Matthew Hazlett2-Feb-04 16:22
Matthew Hazlett2-Feb-04 16:22 
GeneralCalling a .NET Component from a COM Component Pin
Shahin772-Feb-04 9:11
Shahin772-Feb-04 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.