I want to set the background of a cell in Excel depending on a condition.
I've tried two methods:
If intVal = 3 Then
CDRLWs.Range("a1").Font.Background = 3
End If
If intVal = 3 Then
CDRLWs.Range("a1").Font.Background = "Red"
End If
Neither are working.
Any suggestions?
Thanks in Advance!
~Elena
CDRLWs.Range("A1").Interior.Colorindex = 3
HTH
--
AP
"Elena" <Elena@discussions.microsoft.com> a écrit dans le message de news:
0FAABA24-4E02-448B-8E43-E7BB6AC1C0D9@microsoft.com...
>I want to set the background of a cell in Excel depending on a condition.
> I've tried two methods:
>
> If intVal = 3 Then
> CDRLWs.Range("a1").Font.Background = 3
> End If
>
> If intVal = 3 Then
> CDRLWs.Range("a1").Font.Background = "Red"
> End If
>
> Neither are working.
>
> Any suggestions?
>
> Thanks in Advance!
> ~Elena
The background color isn't changing. Any other ideas?
Thanks!
"Ardus Petus" wrote:
> CDRLWs.Range("A1").Interior.Colorindex = 3
>
> HTH
> --
> AP
>
> "Elena" <Elena@discussions.microsoft.com> a écrit dans le message de news:
> 0FAABA24-4E02-448B-8E43-E7BB6AC1C0D9@microsoft.com...
> >I want to set the background of a cell in Excel depending on a condition.
> > I've tried two methods:
> >
> > If intVal = 3 Then
> > CDRLWs.Range("a1").Font.Background = 3
> > End If
> >
> > If intVal = 3 Then
> > CDRLWs.Range("a1").Font.Background = "Red"
> > End If
> >
> > Neither are working.
> >
> > Any suggestions?
> >
> > Thanks in Advance!
> > ~Elena
>
>
>
Disregard previous message. It works perfectly. THANK YOU!
"Ardus Petus" wrote:
> CDRLWs.Range("A1").Interior.Colorindex = 3
>
> HTH
> --
> AP
>
> "Elena" <Elena@discussions.microsoft.com> a écrit dans le message de news:
> 0FAABA24-4E02-448B-8E43-E7BB6AC1C0D9@microsoft.com...
> >I want to set the background of a cell in Excel depending on a condition.
> > I've tried two methods:
> >
> > If intVal = 3 Then
> > CDRLWs.Range("a1").Font.Background = 3
> > End If
> >
> > If intVal = 3 Then
> > CDRLWs.Range("a1").Font.Background = "Red"
> > End If
> >
> > Neither are working.
> >
> > Any suggestions?
> >
> > Thanks in Advance!
> > ~Elena
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks