View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Scott Campbell[_2_] Scott Campbell[_2_] is offline
external usenet poster
 
Posts: 11
Default Rename Multiple Excel Workbooks based on cell contents

I have the following code below that is designed to save the active worksheet
based on cell contents.

I have a file with hundreds of workbooks that need to be renamed. Is there
a way to add to this code to make it so that all files in a specific folder
get rename based on the cell contents?

Here is the code:

sub save_it()
dim fname
with activeworkbook
fname = €œSL-€œ.worksheets("sheet1").range("F4").value & _
.worksheets("sheet1").range("F3").value &
_.worksheets(€œSheet1€).range(€œF1€).value &_
".xls"

..saveas fname
end with
end sub

Thanks for the help.