Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
File name to Cell
Hi
I have used the below code to open each workbook and format , now is it possible to add a macro code so that it should add the workbook file name to cell A2 example: if the file name is AU.xls then in same file in Cell A1 the name should come as Austrila, and if the file name is BU.xls then in same file Cell A1 the name should come as Burma etc.. Sub test() Dim intTemp As Integer Dim arrWorkBook As Variant arrWorkBook = Array("AU.xls", "BU.xls", "DU.xls", "EF.xls") For intTemp = 0 To UBound(arrWorkBook) Workbooks.Open Filename:="C:\N\" & arrWorkBook(intTemp) Rows("1:1").Select With Selection.Interior ..ColorIndex = 6 ..Pattern = xlSolid End With Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
import file so that it is a actual csv file, no excel cell version | New Users to Excel | |||
Macro to Open excel file when file name is entered in cell | Excel Programming | |||
Autoname a save as file from a cell in a read only file | Excel Discussion (Misc queries) | |||
Copying of cell text from one file to paste as cell comments in a 2nd file | Excel Programming | |||
Saving a file(new) using the multiple cell contents as a file name | Excel Programming |