Passing argument in printing headers - title 
Author Message
 Passing argument in printing headers - title

I'm struggling to find the right coding to print out a title based on
a selected case - facTitle that is passed to print the title on a
report.... if I use this way as follows:

.CenterHeader = _
        "&G" & Chr(10) & "" & Chr(10) & "&""Arial,Bold"" &14 facTitle
&""Arial,Regular""&10" & Chr(10) & "" & Chr(10) &
"&""Arial,Bold""&14Monthly Eastbound Traffic - Vehicular Traffic By
Type"

As a result it would show  "facTitle" on a report header which I would
rather see "Holland Tunnel" instead...

See below...

Thanks

Public Sub Print_Reports(facility)

    Dim facTitle As String

    Select Case facility

        Case "HT"
          facTitle = "Holland Tunnel"

        Case "LT"
          facTitle = "Lincoln Tunnel"

        Case "GWB"
          facTitle = "George Washington Bridge"
        Case "ALLX"
          facTitle = "All Crossings"
    End Select

    Range("A2:O35").Select

    With ActiveSheet.PageSetup
        .CenterHeader = _
        "&G" & Chr(10) & "" & Chr(10) & "&""Arial,Bold"" &14 facTitle
&""Arial,Regular""&10" & Chr(10) & "" & Chr(10) &
"&""Arial,Bold""&14Monthly Eastbound Traffic - Vehicular Traffic By
Type"
    End With

    Selection.PrintOut Copies:=1, Collate:=True

End Sub



Mon, 04 Jul 2005 01:27:55 GMT  
 Passing argument in printing headers - title
Put a quote between the 14 and factTitle
example:

No variable:

ActiveSheet.PageSetup.CenterHeader = _
        "&""Arial,Bold""&14My Report" & Chr(10) & "" & Chr
(10) & "&""Arial,Regular""&10Developed 1/15/02"

Variable:

mytest = "New Title"
    ActiveSheet.PageSetup.CenterHeader = _
        "&""Arial,Bold""&14" & mytest & Chr(10) & "" & Chr
(10) & "&""Arial,Regular""&10Developed 1/15/02"

Quote:
>-----Original Message-----
>I'm struggling to find the right coding to print out a
title based on
>a selected case - facTitle that is passed to print the
title on a
>report.... if I use this way as follows:

>..CenterHeader = _
>        "&G" & Chr(10) & "" & Chr(10) & "&""Arial,Bold""
&14 facTitle
>&""Arial,Regular""&10" & Chr(10) & "" & Chr(10) &
>"&""Arial,Bold""&14Monthly Eastbound Traffic - Vehicular
Traffic By
>Type"

>As a result it would show  "facTitle" on a report header
which I would
>rather see "Holland Tunnel" instead...

>See below...

>Thanks

>Public Sub Print_Reports(facility)

>    Dim facTitle As String

>    Select Case facility

>        Case "HT"
>          facTitle = "Holland Tunnel"

>        Case "LT"
>          facTitle = "Lincoln Tunnel"

>        Case "GWB"
>          facTitle = "George Washington Bridge"
>        Case "ALLX"
>          facTitle = "All Crossings"
>    End Select

>    Range("A2:O35").Select

>    With ActiveSheet.PageSetup
>        .CenterHeader = _
>        "&G" & Chr(10) & "" & Chr(10) & "&""Arial,Bold""
&14 facTitle
>&""Arial,Regular""&10" & Chr(10) & "" & Chr(10) &
>"&""Arial,Bold""&14Monthly Eastbound Traffic - Vehicular
Traffic By
>Type"
>    End With

>    Selection.PrintOut Copies:=1, Collate:=True

>End Sub
>.



Mon, 04 Jul 2005 02:26:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Title of document in the header of print

2. Passing arguments to my offset formula

3. Pass an argument to an Access query with sql

4. passing many arguments to a function in Excel

5. Passing an entire column as an argument in a function

6. Using the undo feature AND passing arguments...

7. Pass Variable Argument to OnTime

8. How to pass arguments to a procedure

9. How to use the input box to pass a range argument in VBA

10. Newbie Going Crazy - How to pass user defined data type as Argument


 
Powered by phpBB® Forum Software © phpBB Group