Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with writting macro
Hi
I have a list of code eg. AH100, AH200 etc. in a column on a worksheet with a field name 'StaffIDNo'. I would like to create a workbook for each code, with the code in a specified cell A1 e.g AH100, and the workbooks are saved, 'code' Time allocation schedule.xls e.g AH100 Time allocation schedule.xls in the same specified folder. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with writting macro
nc:
If data in a A column try, Dim wbk As Workbook With ThisWorkbook.Sheets("Sheet1") rPath = ThisWorkbook.Path i = 2 Do While .Cells(i, "A") < "" Set wbk = Workbooks.Add wbk.Sheets("Sheet1").Range("A1") = .Cells(i, "A") wbk.SaveAs Filename:=rPath & "\" & .Cells(i, "A") wbk.Close i = i + 1 Loop End With -- 天行健,君*以自強不息 地勢坤,君*以厚德載物 http://www.vba.com.tw/plog/ "nc" wrote: Hi I have a list of code eg. AH100, AH200 etc. in a column on a worksheet with a field name 'StaffIDNo'. I would like to create a workbook for each code, with the code in a specified cell A1 e.g AH100, and the workbooks are saved, 'code' Time allocation schedule.xls e.g AH100 Time allocation schedule.xls in the same specified folder. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with writting macro | Excel Discussion (Misc queries) | |||
Help with writting macro | Excel Discussion (Misc queries) | |||
Help writting a macro | Excel Programming | |||
Writting a MAcro in Excel | Excel Programming | |||
writting a macro for the sum function so I can use it as a keyboard shortcut | Excel Programming |