Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printer Set Up in VBA

Hi

I am rather new to this so any advice is greatly appreciated.

I am trying to set up a macro which creates a sheet for the user based
on their input. My main stumbling block is entering the required text
as a header in the print-page set up.

I would like to be able to take a string of text from a cell reference
and use it ( or part of it) as a title for the document.

I have been working on this for without success for sometime now.

Thanks in advance
Mike


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Printer Set Up in VBA

Hi PostalVote

Try this

It will add a sheet to your workbook
And use cell A1 if the activesheet in the footer (or header)

Sub test()
Dim Aws As Worksheet
Dim Nws As Worksheet

Set Aws = ActiveSheet
Set Nws = Worksheets.Add

With Nws
.PageSetup.LeftFooter = Aws.Range("a1").Value
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"PostalVote " wrote in message ...
Hi

I am rather new to this so any advice is greatly appreciated.

I am trying to set up a macro which creates a sheet for the user based
on their input. My main stumbling block is entering the required text
as a header in the print-page set up.

I would like to be able to take a string of text from a cell reference
and use it ( or part of it) as a title for the document.

I have been working on this for without success for sometime now.

Thanks in advance
Mike


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printer Set Up in VBA

Try this, it takes all of name from cell reference C5 and puts it t
centerheader.



Sub Macro1()

Dim TitleOfDocument As String

'set variable titleofdocument to be value of cell C5
TitleOfDocument = Cells(5, 3).Value
'
With ActiveSheet.PageSetup
.CenterHeader = TitleOfDocument
End With
End Su

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printer Set Up in VBA

Worked an absolute treat, exactly what I was looking for.

Many thanks
Mik

--
Message posted from http://www.ExcelForum.com

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
Printer Rey Excel Discussion (Misc queries) 3 October 23rd 07 09:02 PM
members on my network printer not able to print to default printer smeheut Excel Discussion (Misc queries) 0 June 18th 07 06:42 PM
Printer Multiple Worksheets with a particular Printer Setting PP[_2_] Excel Worksheet Functions 0 March 14th 07 02:02 PM
Printing with B&W printer edwardpestian Excel Discussion (Misc queries) 1 July 25th 06 04:56 AM
Printer Settings MERLYN KNIGHT Excel Programming 0 February 27th 04 06:08 PM


All times are GMT +1. The time now is 05:29 AM.

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

About Us

"It's about Microsoft Excel"