A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

copying text across worksheets



 
 
Thread Tools Display Modes
  #1  
Old October 14th, 2003, 02:00 PM
Roxy
external usenet poster
 
Posts: n/a
Default copying text across worksheets

I have to add a column of text (5 codes) to my totals page
in my workbook. I also need this column containing the
new codes on the other 120 worksheets in the same workbook
(in the same place). Is there a way to do it once that it
will update the other pages or am I looking at a lot of
cutting and pasting?

Thanks.
  #2  
Old October 14th, 2003, 02:18 PM
John Hayes
external usenet poster
 
Posts: n/a
Default copying text across worksheets

This should work.

Tools....Macros...VisualBasic Editor
Click on your Workbook in the Project Explorer and Select

Insert..Module

Doubleclick on the new module and type the following (or
copy and paste it from here)

Dim mysht as Worksheet

For each mysht in thiswokbook.sheets
with mysht
.columns(1).insert '1 to insert it at column A
.cells(1,1)="code1" ' Cell A1 gets this text
.cells(2,1)="Code2" ' Cell A2 gets this text
.cells(3,1)="Code3" ' Cell A3
.cells(4,1)="Code4" ' Cell A4
.cells(5,1)="Code5" ' Cell A5



next


-----Original Message-----
I have to add a column of text (5 codes) to my totals

page
in my workbook. I also need this column containing the
new codes on the other 120 worksheets in the same

workbook
(in the same place). Is there a way to do it once that

it
will update the other pages or am I looking at a lot of
cutting and pasting?

Thanks.
.

  #3  
Old October 14th, 2003, 02:31 PM
John HAyes
external usenet poster
 
Posts: n/a
Default copying text across worksheets

Original code didn't close the With Statement
This one is correct

Dim mysht as Worksheet

For each mysht in thiswokbook.sheets
with mysht
.columns(1).insert '1 to insert it at column A
.cells(1,1)="code1" ' Cell A1 gets this text
.cells(2,1)="Code2" ' Cell A2 gets this text
.cells(3,1)="Code3" ' Cell A3
.cells(4,1)="Code4" ' Cell A4
.cells(5,1)="Code5" ' Cell A5

END WITH

next




-----Original Message-----
This should work.

Tools....Macros...VisualBasic Editor
Click on your Workbook in the Project Explorer and Select

Insert..Module

Doubleclick on the new module and type the following (or
copy and paste it from here)

Dim mysht as Worksheet

For each mysht in thiswokbook.sheets
with mysht
.columns(1).insert '1 to insert it at column A
.cells(1,1)="code1" ' Cell A1 gets this text
.cells(2,1)="Code2" ' Cell A2 gets this text
.cells(3,1)="Code3" ' Cell A3
.cells(4,1)="Code4" ' Cell A4
.cells(5,1)="Code5" ' Cell A5



next


-----Original Message-----
I have to add a column of text (5 codes) to my totals

page
in my workbook. I also need this column containing the
new codes on the other 120 worksheets in the same

workbook
(in the same place). Is there a way to do it once that

it
will update the other pages or am I looking at a lot of
cutting and pasting?

Thanks.
.

.

  #4  
Old October 15th, 2003, 04:36 PM
Roxy
external usenet poster
 
Posts: n/a
Default copying text across worksheets

My user completed the following steps and got it to work
without having to utilize VB.

If you've already entered data on one worksheet, you can
quickly copy the data to corresponding cells on other
sheets.

Select the sheet that contains the data and the sheets to
which you want to copy the data.
Select the cells that contain the data you want to copy.
On the Edit menu, point to Fill, and then click Across
Worksheets.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


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