Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy from worksheet to worksheet with Macro
Hi All,
I don't program macros in Excell often, but would like to automate a monthly spreadsheet. I would like to copy the headers from the January worksheet to the current month and format. I can get it to do the formating, but what syntax is necessary to copy A!-E1 in the January 22,2003 sheet to one for September, October etc (assuming that I am in the current month's sheet). Many thanks in advance.. Best, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy from worksheet to worksheet with Macro
Easiest way is to select the sheets you want by ctrl+sheet keytype in the
headersselect only one sheetdone "Robert L. Altic Jr." wrote in message ... Hi All, I don't program macros in Excell often, but would like to automate a monthly spreadsheet. I would like to copy the headers from the January worksheet to the current month and format. I can get it to do the formating, but what syntax is necessary to copy A!-E1 in the January 22,2003 sheet to one for September, October etc (assuming that I am in the current month's sheet). Many thanks in advance.. Best, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy from worksheet to worksheet with Macro
worksheets("January 22,2003").Range("A1:E1").Copy _
Destination:=ActiveSheet.Range("A1:E1") Check the name of the January sheet - should there be a space after the comma? -- Regards, Tom Ogilvy "Robert L. Altic Jr." wrote in message ... Hi All, I don't program macros in Excell often, but would like to automate a monthly spreadsheet. I would like to copy the headers from the January worksheet to the current month and format. I can get it to do the formating, but what syntax is necessary to copy A!-E1 in the January 22,2003 sheet to one for September, October etc (assuming that I am in the current month's sheet). Many thanks in advance.. Best, |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy from worksheet to worksheet with Macro
On Fri, 12 Sep 2003 11:39:48 -0400, "Tom Ogilvy"
wrote: worksheets("January 22,2003").Range("A1:E1").Copy _ Destination:=ActiveSheet.Range("A1:E1") Check the name of the January sheet - should there be a space after the comma? -- Regards, Tom Ogilvy "Robert L. Altic Jr." wrote in message .. . Hi All, I don't program macros in Excell often, but would like to automate a monthly spreadsheet. I would like to copy the headers from the January worksheet to the current month and format. I can get it to do the formating, but what syntax is necessary to copy A!-E1 in the January 22,2003 sheet to one for September, October etc (assuming that I am in the current month's sheet). Many thanks in advance.. Best, Hi Tom, Did your suggestion changing the date on the first tab and get a subscript out of range message. Suggestions? copy of macro: Sub test() ' ' test Macro ' Macro recorded 6/14/2003 by Robert L. Altic Jr. ' ' Worksheets("January 22, 2003").Range("A1:E1").Copy _ Destination:=ActiveSheet.Range("A1:E1") End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy from worksheet to worksheet with Macro
You get that error message if "January 22,2003". does not match the name
on the worksheet tab. ONLY you can check that. In otherwords, Mike doesn't answer to the name Bob. As an example. -- Regards, Tom Ogilvy "Robert L. Altic Jr." wrote in message ... On Fri, 12 Sep 2003 11:39:48 -0400, "Tom Ogilvy" wrote: worksheets("January 22,2003").Range("A1:E1").Copy _ Destination:=ActiveSheet.Range("A1:E1") Check the name of the January sheet - should there be a space after the comma? -- Regards, Tom Ogilvy "Robert L. Altic Jr." wrote in message .. . Hi All, I don't program macros in Excell often, but would like to automate a monthly spreadsheet. I would like to copy the headers from the January worksheet to the current month and format. I can get it to do the formating, but what syntax is necessary to copy A!-E1 in the January 22,2003 sheet to one for September, October etc (assuming that I am in the current month's sheet). Many thanks in advance.. Best, Hi Tom, Did your suggestion changing the date on the first tab and get a subscript out of range message. Suggestions? copy of macro: Sub test() ' ' test Macro ' Macro recorded 6/14/2003 by Robert L. Altic Jr. ' ' Worksheets("January 22, 2003").Range("A1:E1").Copy _ Destination:=ActiveSheet.Range("A1:E1") End Sub |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy from worksheet to worksheet with Macro
There is no reason to have the range after the copy be a single cell - it
must be a single cell or an exact match in terms of size - it is an exact match in the sample I provided. -- Regards, Tom Ogilvy Otto Moehrbach wrote in message ... Robert The range after the word "Copy" should be Range("A1"). That's not the reason for the error message. Tom is right that you should check that the name of the January sheet is correctly written in the macro. HTH Otto "Robert L. Altic Jr." wrote in message ... On Fri, 12 Sep 2003 11:39:48 -0400, "Tom Ogilvy" wrote: worksheets("January 22,2003").Range("A1:E1").Copy _ Destination:=ActiveSheet.Range("A1:E1") Check the name of the January sheet - should there be a space after the comma? -- Regards, Tom Ogilvy "Robert L. Altic Jr." wrote in message .. . Hi All, I don't program macros in Excell often, but would like to automate a monthly spreadsheet. I would like to copy the headers from the January worksheet to the current month and format. I can get it to do the formating, but what syntax is necessary to copy A!-E1 in the January 22,2003 sheet to one for September, October etc (assuming that I am in the current month's sheet). Many thanks in advance.. Best, Hi Tom, Did your suggestion changing the date on the first tab and get a subscript out of range message. Suggestions? copy of macro: Sub test() ' ' test Macro ' Macro recorded 6/14/2003 by Robert L. Altic Jr. ' ' Worksheets("January 22, 2003").Range("A1:E1").Copy _ Destination:=ActiveSheet.Range("A1:E1") End Sub |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy from worksheet to worksheet with Macro
Thanks Tom. I thought it would paste the entire copy range starting with
each cell of the destination range. I learned something else from you today. Otto "Tom Ogilvy" wrote in message ... There is no reason to have the range after the copy be a single cell - it must be a single cell or an exact match in terms of size - it is an exact match in the sample I provided. -- Regards, Tom Ogilvy Otto Moehrbach wrote in message ... Robert The range after the word "Copy" should be Range("A1"). That's not the reason for the error message. Tom is right that you should check that the name of the January sheet is correctly written in the macro. HTH Otto "Robert L. Altic Jr." wrote in message ... On Fri, 12 Sep 2003 11:39:48 -0400, "Tom Ogilvy" wrote: worksheets("January 22,2003").Range("A1:E1").Copy _ Destination:=ActiveSheet.Range("A1:E1") Check the name of the January sheet - should there be a space after the comma? -- Regards, Tom Ogilvy "Robert L. Altic Jr." wrote in message .. . Hi All, I don't program macros in Excell often, but would like to automate a monthly spreadsheet. I would like to copy the headers from the January worksheet to the current month and format. I can get it to do the formating, but what syntax is necessary to copy A!-E1 in the January 22,2003 sheet to one for September, October etc (assuming that I am in the current month's sheet). Many thanks in advance.. Best, Hi Tom, Did your suggestion changing the date on the first tab and get a subscript out of range message. Suggestions? copy of macro: Sub test() ' ' test Macro ' Macro recorded 6/14/2003 by Robert L. Altic Jr. ' ' Worksheets("January 22, 2003").Range("A1:E1").Copy _ Destination:=ActiveSheet.Range("A1:E1") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Macro with Worksheet | Excel Discussion (Misc queries) | |||
Macro Copy Worksheet Name into worksheet A1 | Excel Worksheet Functions | |||
VB Macro to Copy from Worksheet | Excel Discussion (Misc queries) | |||
macro to copy worksheet | Excel Worksheet Functions | |||
I need help with a macro which will copy a worksheet and.. | Excel Worksheet Functions |