Shade rows ....

toleafs

Active Member
Joined
Jun 27, 2005
Messages
498
Hello
Any advice is appreciated. I have the following code that works in another dB, but not in my current one I just created. I am getting a compile error: Variable not defined, on the word Detail. Any suggestions. Thank for your time

Private Sub secDetail_Format(Cancel As Integer, FormatCount As Integer)
Const conLtGray = 15263976

If Detail.BackColor = conLtGray Then
Detail.BackColor = vbWhite
Else
Detail.BackColor = conLtGray
End If
End Sub
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
It seems in your other database that the detail section is named "Detail", but in your current database it's called "secDetail" -- I can tell from the name of the Sub. So I think all you need to do is this:

Code:
Private Sub [B][I]secDetail[/I][/B]_Format(Cancel As Integer, FormatCount As Integer)
Const conLtGray = 15263976
 
If [B][COLOR=darkgreen][I]secDetail[/I][/COLOR][/B].BackColor = conLtGray Then
    [COLOR=darkgreen][B][I]secDetail[/I][/B][/COLOR].BackColor = vbWhite
Else
    [COLOR=darkgreen][B][I]secDetail[/I][/B][/COLOR].BackColor = conLtGray
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top