Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Make the changes to the Parent applicable to all copied files

I work with the job of entering datas in preset formats of several
compaines. I have a table with number of rows and columns in a file of
MS-excel. I have made this as a PARENT and copied several such files
for data entry. Now, after I have completed most of the job, I found
that I forgot to add the sum column in the parent Excel file. Now, I
want to add a column to the parent file such that once I have added
(and/or removed ) the column, this change be made to all the files
that I have made a copy of.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Make the changes to the Parent applicable to all copied files

open the VBA editor (ALT+F11)
add a new module ( INSERT / MODULE)
and paste in the following code. It will sum column B, C,D ... while there
is a heading in row 1, of Sheet1

you can run this against all your workbooks....(AddSums) or run SumBooks
that runs AddSums for each book in a specified folder. Again, it will assume
that the sheet os called sheet1

you may want to change values appropriately

Option Explicit

Sub AddSums()
Dim cl As Range
Set cl = Worksheets("sheet1").Range("B1")
Do Until cl.Value = ""
With cl.End(xlDown).Offset(1)
.FormulaR1C1 = "=SUM(R[-1]C:R1C)"
End With
Set cl = cl.Offset(, 1)
Loop
End Sub
Sub SumBooks()
Dim sFile As String
Dim wb As Workbook
Const sPath As String = "S:|temp\"
sFile = Dir(sPath & "*.xls")
Do While sFile < ""
Set wb = Workbooks.Open(sPath & sFile)
AddSums
wb.Close True ' close & save
Set wb = Nothing
sFile = Dir(sPath & "*.xls")
Loop

End Sub




"Subodh" wrote:

I work with the job of entering datas in preset formats of several
compaines. I have a table with number of rows and columns in a file of
MS-excel. I have made this as a PARENT and copied several such files
for data entry. Now, after I have completed most of the job, I found
that I forgot to add the sum column in the parent Excel file. Now, I
want to add a column to the parent file such that once I have added
(and/or removed ) the column, this change be made to all the files
that I have made a copy of.
.

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
Can I make a worksheet that can not be copied Linda Barone[_2_] Excel Programming 3 February 4th 09 03:19 PM
Do VLOOKUPs require the applicable other files to be open? ulupi Excel Discussion (Misc queries) 1 December 20th 06 04:43 PM
how to default WritePassword under excel workbook property for any files as long as those files are the offsprings of the parent file George Excel Programming 0 October 5th 06 04:14 PM
How can I make the copied range from another worksheet independently sam[_8_] Excel Programming 1 May 21st 06 09:44 PM
copy subfolders, replace text in files and save files in copied subfolders pieros Excel Programming 0 November 1st 05 12:08 PM


All times are GMT +1. The time now is 03:23 PM.

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"