#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Quarantine workbooks

is it possible to do a global quarantine of a selection of workbooks by
adding the word 'QUARANTINE' to the same cell in each workbook, without
having to open each workbook one at a time. Hopefully I would be able to
specifiy the size and colour of font also.

i.e. selecting a number of workbooks in a folder then running a macro to do
an update to a particular cell. Or is there a system already built into Excel
to allow this? Ihaven't found one.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 208
Default Quarantine workbooks

I'm not sure of the code to open the workbooks but if you open all of
the workbooks first, then this macro will work.


sub quarantine()

for x =1 to application.workbooks.count
application.workbooks(x).select
sheets(1).select
range(a1).value = "Quarantine"
next
end sub


On Jul 11, 12:10*pm, Chacky wrote:
is it possible to do a global quarantine of a selection of workbooks by
adding the word 'QUARANTINE' to the same cell in each workbook, without
having to open each workbook one at a time. Hopefully I would be able to
specifiy the size and colour of font also.

i.e. selecting a number of workbooks in a folder then running a macro to do
an update to a particular cell. Or is there a system already built into Excel
to allow this? Ihaven't found one.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Quarantine workbooks

Hi,

Right click a sheet tab of an open workbook, view code and paste this in and
run it. You will need to set the pasth to what you want. Currently the root
of C

Sub quarantimeME()
Dim fn As String
TargetFolder = "C:\"
FileFilter = "*.xls"
Application.ScreenUpdating = False
fn = Dir(TargetFolder & FileFilter)
While Len(fn) 0
If fn < ThisWorkbook.Name Then
Workbooks.Open TargetFolder & fn
ActiveWorkbook.Sheets("sheet1").Range("A1").Value = "Quarrantine"
ActiveWorkbook.Close True
End If
fn = Dir
Wend
End Sub

Mike

"Chacky" wrote:

is it possible to do a global quarantine of a selection of workbooks by
adding the word 'QUARANTINE' to the same cell in each workbook, without
having to open each workbook one at a time. Hopefully I would be able to
specifiy the size and colour of font also.

i.e. selecting a number of workbooks in a folder then running a macro to do
an update to a particular cell. Or is there a system already built into Excel
to allow this? Ihaven't found one.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Quarantine workbooks

Tim879

Thanks for the help. This is the sort of thing I am looking for but when I
run the macro I get the message

RUN TIME ERROR '438'
OBJECT DOESN'T SUPPORT THIS PROPERTY OR METHOD

"Tim879" wrote:

I'm not sure of the code to open the workbooks but if you open all of
the workbooks first, then this macro will work.


sub quarantine()

for x =1 to application.workbooks.count
application.workbooks(x).select
sheets(1).select
range(a1).value = "Quarantine"
next
end sub


On Jul 11, 12:10 pm, Chacky wrote:
is it possible to do a global quarantine of a selection of workbooks by
adding the word 'QUARANTINE' to the same cell in each workbook, without
having to open each workbook one at a time. Hopefully I would be able to
specifiy the size and colour of font also.

i.e. selecting a number of workbooks in a folder then running a macro to do
an update to a particular cell. Or is there a system already built into Excel
to allow this? Ihaven't found one.



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
Stop Symantec AV from quarantine my VBA EagleOne@microsoftdiscussiongroups Excel Discussion (Misc queries) 4 May 15th 08 06:58 PM
Copy/ move selected data from workbooks to seperate worksheets or workbooks Positive Excel Worksheet Functions 1 August 30th 07 04:54 PM
Display 2 formulas from source workbooks to destination workbooks Excel_seek_help Excel Discussion (Misc queries) 4 April 27th 06 08:13 PM
suddenly my excel workbooks are "shared workbooks" Maggie's mom Excel Discussion (Misc queries) 1 August 28th 05 09:20 PM


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