Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Copy Contract Number to CenterFooter on multiple sheets

In part, I have the following that takes a Contract number generated in
workbook called QCNUM and puts it in "active" Workbook, Sheet# 1 called
"Contracts", Cell E4

' The following is "paste into"
myBook.Worksheets("Contract").Range("E4").Value = _
' The following is "copy from"
myQCNUM.Worksheets("Sheet2").Range("G6").Value

(I don't know why the above has to be entered as shown - it seems backwards
to me, BUT, it Works.)

Somehow, I need to have the Contract number inserted in the CentreFooter of
sheets: "Options", "Pricing", "Notes", Warranty_CDN", Warranty_USA"
Is it neccessary to duplicate the above 2 lines (changing only sheet name),
for each of the required sheets? or is there a handy-dandy shorter process
that can be used.

Thanks in advance for any input..............


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Copy Contract Number to CenterFooter on multiple sheets

First off, your code is not a copy/paste even if it has some of the effects
of such. Think of it as what it is - programmatically setting the value of
one cell equal to another.

Your code also has nothing to do with setting a page footer, so that's a
little confusing. You would have to set them individually for each sheet
but that's easy in a loop.

Sub a()
Dim WS As Worksheet
For Each WS In Worksheets(Array("Sheet1", "Sheet2", "Sheet3"))
WS.PageSetup.CenterFooter = "abc"
Next
End Sub

--
Jim
"BEEJAY" wrote in message
...
| In part, I have the following that takes a Contract number generated in
| workbook called QCNUM and puts it in "active" Workbook, Sheet# 1 called
| "Contracts", Cell E4
|
| ' The following is "paste into"
| myBook.Worksheets("Contract").Range("E4").Value = _
| ' The following is "copy from"
| myQCNUM.Worksheets("Sheet2").Range("G6").Value
|
| (I don't know why the above has to be entered as shown - it seems
backwards
| to me, BUT, it Works.)
|
| Somehow, I need to have the Contract number inserted in the CentreFooter
of
| sheets: "Options", "Pricing", "Notes", Warranty_CDN", Warranty_USA"
| Is it neccessary to duplicate the above 2 lines (changing only sheet
name),
| for each of the required sheets? or is there a handy-dandy shorter process
| that can be used.
|
| Thanks in advance for any input..............
|
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy Contract Number to CenterFooter on multiple sheets

that line doesn't put it in the centerheader anyway, Unless your header
references that cell (by using code). If it does, then just group your
sheets and select E4 and do
Range("E4").Value = myQCNUM.Worksheets("Sheet2").Range("G6").Value
then run you code on each sheet.

in any event, for the most part,
you have to do the pagesetup on each page individually.

--
Regards,
Tom Ogilvy


"BEEJAY" wrote in message
...
In part, I have the following that takes a Contract number generated in
workbook called QCNUM and puts it in "active" Workbook, Sheet# 1 called
"Contracts", Cell E4

' The following is "paste into"
myBook.Worksheets("Contract").Range("E4").Value = _
' The following is "copy from"
myQCNUM.Worksheets("Sheet2").Range("G6").Value

(I don't know why the above has to be entered as shown - it seems

backwards
to me, BUT, it Works.)

Somehow, I need to have the Contract number inserted in the CentreFooter

of
sheets: "Options", "Pricing", "Notes", Warranty_CDN", Warranty_USA"
Is it neccessary to duplicate the above 2 lines (changing only sheet

name),
for each of the required sheets? or is there a handy-dandy shorter process
that can be used.

Thanks in advance for any input..............




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Copy Contract Number to CenterFooter on multiple sheets

Jim:
Thanks for your comments........
have studied and tried you suggestion.
I'm stuck on how to get cell E4 from page called "contract",
to be the one and only cell that is used to set the centerfooter
on each WS in the array. I have tried a variety of approaches but
I hope I'm close with the following. However, my effort which
comes up with a compile error.
Your help would be greatly appreciated.

"Jim Rech" wrote:

First off, your code is not a copy/paste even if it has some of the effects
of such. Think of it as what it is - programmatically setting the value of
one cell equal to another.

Your code also has nothing to do with setting a page footer, so that's a
little confusing. You would have to set them individually for each sheet
but that's easy in a loop.

Sub a()
Dim WS As Worksheet
For Each WS In Worksheets(Array("Sheet1", "Sheet2", "Sheet3"))
WS.PageSetup.CenterFooter = "abc"
Next
End Sub

--
Jim
"BEEJAY" wrote in message
...
| In part, I have the following that takes a Contract number generated in
| workbook called QCNUM and puts it in "active" Workbook, Sheet# 1 called
| "Contracts", Cell E4
|
| ' The following is "paste into"
| myBook.Worksheets("Contract").Range("E4").Value = _
| ' The following is "copy from"
| myQCNUM.Worksheets("Sheet2").Range("G6").Value
|
| (I don't know why the above has to be entered as shown - it seems
backwards
| to me, BUT, it Works.)
|
| Somehow, I need to have the Contract number inserted in the CentreFooter
of
| sheets: "Options", "Pricing", "Notes", Warranty_CDN", Warranty_USA"
| Is it neccessary to duplicate the above 2 lines (changing only sheet
name),
| for each of the required sheets? or is there a handy-dandy shorter process
| that can be used.
|
| Thanks in advance for any input..............
|
|



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Copy Contract Number to CenterFooter on multiple sheets

It would have been helpful to send the following along, as I had originally
intended.
Sorry.


Sub CentreFooter()
'
' CentreFooter Macro
' Take Quote number from Contract Cover page (Sheet 1), Cell E4,
' and enter in Center Footer on all other sheets in contract.
'

Dim WS As Worksheet

For Each WS In Worksheets(Array("Options", "Pricing", "Notes", _
"Warranty_CDN", "Warranty_USA"))

WS.PageSetup.CenterFooter = Worksheets("Contract").Range("E4").Text
Next WS
End Sub


"Jim Rech" wrote:

First off, your code is not a copy/paste even if it has some of the effects
of such. Think of it as what it is - programmatically setting the value of
one cell equal to another.

Your code also has nothing to do with setting a page footer, so that's a
little confusing. You would have to set them individually for each sheet
but that's easy in a loop.

Sub a()
Dim WS As Worksheet
For Each WS In Worksheets(Array("Sheet1", "Sheet2", "Sheet3"))
WS.PageSetup.CenterFooter = "abc"
Next
End Sub

--
Jim
"BEEJAY" wrote in message
...
| In part, I have the following that takes a Contract number generated in
| workbook called QCNUM and puts it in "active" Workbook, Sheet# 1 called
| "Contracts", Cell E4
|
| ' The following is "paste into"
| myBook.Worksheets("Contract").Range("E4").Value = _
| ' The following is "copy from"
| myQCNUM.Worksheets("Sheet2").Range("G6").Value
|
| (I don't know why the above has to be entered as shown - it seems
backwards
| to me, BUT, it Works.)
|
| Somehow, I need to have the Contract number inserted in the CentreFooter
of
| sheets: "Options", "Pricing", "Notes", Warranty_CDN", Warranty_USA"
| Is it neccessary to duplicate the above 2 lines (changing only sheet
name),
| for each of the required sheets? or is there a handy-dandy shorter process
| that can be used.
|
| Thanks in advance for any input..............
|
|





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Copy Contract Number to CenterFooter on multiple sheets

Tried it again, today.
This time, while in edit mode, (F8), it comes up with Run Time Error 9,
Subscript out of Range.
However, when I tried the macro on an actual file for which it was designed,
it (seemed to) work fine. The CenterFooter was inserted on each of the WS's
specified in the array, and not on the other WS's.
I'd feel a lot better if the problems/errors showing during "test" stage
could be made to disappear, since I shortly have to send the new menu to my
salesforce around the world.
Looking forward to your thoughts.............

"Jim Rech" wrote:

First off, your code is not a copy/paste even if it has some of the effects
of such. Think of it as what it is - programmatically setting the value of
one cell equal to another.

Your code also has nothing to do with setting a page footer, so that's a
little confusing. You would have to set them individually for each sheet
but that's easy in a loop.

Sub a()
Dim WS As Worksheet
For Each WS In Worksheets(Array("Sheet1", "Sheet2", "Sheet3"))
WS.PageSetup.CenterFooter = "abc"
Next
End Sub

--
Jim
"BEEJAY" wrote in message
...
| In part, I have the following that takes a Contract number generated in
| workbook called QCNUM and puts it in "active" Workbook, Sheet# 1 called
| "Contracts", Cell E4
|
| ' The following is "paste into"
| myBook.Worksheets("Contract").Range("E4").Value = _
| ' The following is "copy from"
| myQCNUM.Worksheets("Sheet2").Range("G6").Value
|
| (I don't know why the above has to be entered as shown - it seems
backwards
| to me, BUT, it Works.)
|
| Somehow, I need to have the Contract number inserted in the CentreFooter
of
| sheets: "Options", "Pricing", "Notes", Warranty_CDN", Warranty_USA"
| Is it neccessary to duplicate the above 2 lines (changing only sheet
name),
| for each of the required sheets? or is there a handy-dandy shorter process
| that can be used.
|
| Thanks in advance for any input..............
|
|



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
copy rows to multiple sheets pvkutty Excel Discussion (Misc queries) 1 February 24th 10 07:25 AM
Using contract start/end dates and calculating annual contract day Redcon Excel Discussion (Misc queries) 3 April 19th 08 12:03 AM
Copy data to multiple sheets HighlandRoss Excel Worksheet Functions 2 February 27th 08 08:38 PM
Multiple sheets selection and copy syaronc[_6_] Excel Programming 1 October 25th 04 12:40 PM
Copy from Multiple Sheets Eric[_23_] Excel Programming 3 August 5th 04 07:00 PM


All times are GMT +1. The time now is 09:32 AM.

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"