seperate codes...vba

toleafs

Active Member
Joined
Jun 27, 2005
Messages
498
Hello... any advice is appreciated. I have the following select cases. What I want to do is when 'Case A' is chosen at the prompt ( where all codes are reported), I woud like to show:

Const cTitle2 As String = "Data Elements" : in red font so that there is a visble distinguish between the different codes...

Hope this makes sense.
Thanks in advance for your help


_______________
Private Sub Report_Open(Cancel As Integer)
Const cTitle1 As String = "- All Source Codes -"
Const cTitle2 As String = "Data Elements"
Const cTitle3 As String = "Data Sources"

Dim strPrompt As String
Dim varResponse As Variant

Let strPrompt = "Enter one of the letters corresponding to the following reports:" & _
vbNewLine & vbNewLine & "A: All Source Codes" & vbNewLine & "B: Data Elements" & _
vbNewLine & "C: Data Sources"

Let varResponse = InputBox(strPrompt, "Title", "A")

With Me
Select Case varResponse
Case "A"
Let .lblTitleLine3.Caption = cTitle1
Let .FilterOn = False
Case "B"
Let .lblTitleLine3.Caption = cTitle2
Let .FilterOn = 1
Let .Filter = "[unionSource]![strRpt] =1"
Case "C"
Let .lblTitleLine3.Caption = cTitle3
Let .FilterOn = 2
Let .Filter = "[unionSource]![strRpt] = 2 "

Case Else
MsgBox "Invalid choice", vbOKOnly
Cancel = 1
End Select
End With
End Sub
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
It is nice you want to do that. Unfortunately it doesn't work that way. The colors used by the IDE are not customizable to that level of detail.
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,854
Members
452,948
Latest member
UsmanAli786

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