Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA Code to Print a Variable as part of CenterHeader Problem

Under PageSetup

..CenterHeader = "&""Arial,Bold""&12CW" + CalWk

I am getting a Type Mismatch when running this line of code.

A earlier line of code,
CalWk = Range("B1").Value
picks up the calendar week number from the worksheet.
When the line tries to run CalWk = 3

Any Help would be appreciated,



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA Code to Print a Variable as part of CenterHeader Problem

"&""Arial,Bold""&12CW" & CalWk

use ampersand instead of +

--
Regards,
Tom Ogilvy


"gvlral" wrote in message
...
Under PageSetup

.CenterHeader = "&""Arial,Bold""&12CW" + CalWk

I am getting a Type Mismatch when running this line of code.

A earlier line of code,
CalWk = Range("B1").Value
picks up the calendar week number from the worksheet.
When the line tries to run CalWk = 3

Any Help would be appreciated,





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VBA Code to Print a Variable as part of CenterHeader Problem

Try

..CenterHeader = "&""Arial,Bold""&12CW" & CalWk

--

HTH

RP
(remove nothere from the email address if mailing direct)


"gvlral" wrote in message
...
Under PageSetup

.CenterHeader = "&""Arial,Bold""&12CW" + CalWk

I am getting a Type Mismatch when running this line of code.

A earlier line of code,
CalWk = Range("B1").Value
picks up the calendar week number from the worksheet.
When the line tries to run CalWk = 3

Any Help would be appreciated,





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reference to a Variable Part of a Cell Hilvert Scheper Excel Worksheet Functions 7 September 3rd 08 11:40 AM
can i link a variable cost code with a variable sum I need help!! Excel Discussion (Misc queries) 0 August 1st 08 11:40 AM
Passing format to variable Part 2 ExcelMonkey[_141_] Excel Programming 1 June 7th 04 03:27 AM
Excel generation and PageSetup.CenterHeader lfb Excel Programming 3 February 9th 04 05:24 PM
Continuing print code problem Stuart[_5_] Excel Programming 0 August 5th 03 06:54 PM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"