+ Reply to Thread
Results 1 to 3 of 3

Formatting a cell range in the Header using VBA

  1. #1
    Registered User
    Join Date
    03-21-2016
    Location
    london,england
    MS-Off Ver
    2010
    Posts
    1

    Formatting a cell range in the Header using VBA

    Hi All,

    I have had a look and cant quite seem to find what I am looking for so hoping someone much clever than I will be able to help me out

    I want to change tge formatting of my headers using VBA - the issue I am having is that I want to use a cell range as my header info

    What I have got so far :

    Sub SaveAs1()
    Sheets("Event Info").Select
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Worksheets
    ws.PageSetup.CenterHeader = ActiveSheet.Range("E3").Value
    ws.PageSetup.RightHeader = ActiveSheet.Range("E2").Value
    Next ws



    So what I want is the centre and the right header to be Red and also bold with a larger font size. But without altering 'E3' & 'E2' formatting


    Thank you in advance

    Steve

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Formatting a cell range in the Header using VBA

    Please attach an example workbook.

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Formatting a cell range in the Header using VBA

    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your own requirements,


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cell formatting not working for table header
    By edward_glyver in forum Excel General
    Replies: 1
    Last Post: 02-03-2016, 09:16 AM
  2. Replies: 4
    Last Post: 12-19-2014, 05:38 PM
  3. [SOLVED] Obtain cell reference below the header of a filtered range.
    By Peter930 in forum Excel General
    Replies: 1
    Last Post: 12-21-2013, 06:09 PM
  4. Replies: 2
    Last Post: 10-13-2012, 03:30 AM
  5. Insert (with formatting!) content of a cell into a header
    By tks1183 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2012, 08:48 PM
  6. copy header and rows toa specific excel range cell
    By karthikin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-07-2012, 12:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1