Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Copy a range of cells to all workbooks in a folder?

Hi all,

Can anybody please help...

I have +100 workbooks that i need to change a named range in (all in a
folder). Is there a way to amend all of them via vba? the thought of
doing it all manually fills me with dread!


ie. Unhide worksheet 'Data', replace range of cells A1:A5 with A, B,
C, D, E and define/name this range as 'Option' and re-hide the sheet

Any help whatsoever would be greatly appreciated.

many thanks

P :-)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy a range of cells to all workbooks in a folder?

Something like this????

Sub changebooks()

MyPath = "c:\temp\"

First = True
Do
If First = True Then
Filename = Dir(MyPath & "*.xls")
First = False
Else
Filename = Dir()
End If

If Filename < "" Then

Workbooks.Open MyPath & Filename
'no need to unhide cells
With Sheets("data")
.Range("A1").Value = A
.Range("A2").Value = B
.Range("A3").Value = C
.Range("A4").Value = D
.Range("A5").Value = E
End With
ActiveWorkbook.Names.Add Name:="Option", _
RefersToR1C1:="=DATA!R1C1:R5C1"
Workbooks(Filename).Close

End If
Loop While Filename < ""

End Sub

" wrote:

Hi all,

Can anybody please help...

I have +100 workbooks that i need to change a named range in (all in a
folder). Is there a way to amend all of them via vba? the thought of
doing it all manually fills me with dread!


ie. Unhide worksheet 'Data', replace range of cells A1:A5 with A, B,
C, D, E and define/name this range as 'Option' and re-hide the sheet

Any help whatsoever would be greatly appreciated.

many thanks

P :-)


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 folder with excel linked workbooks lightbulb Excel Discussion (Misc queries) 1 June 20th 08 06:01 PM
linking cells from workbooks in a folder Giles Excel Worksheet Functions 3 May 23rd 08 05:37 PM
Copy & Paste Range from all Worksheets in all Workbooks in a folder [email protected] Excel Programming 29 April 24th 07 07:11 PM
Copy a cell to all workbooks within a folder. Andy T Excel Discussion (Misc queries) 16 February 2nd 05 11:14 PM
Copy several range from all files in folder into several worksheets Adri[_2_] Excel Programming 13 June 27th 04 03:52 PM


All times are GMT +1. The time now is 08:48 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"