Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
nc nc is offline
external usenet poster
 
Posts: 119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default 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
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
Help with writting macro nc Excel Discussion (Misc queries) 0 November 28th 05 02:45 PM
Help with writting macro nc Excel Discussion (Misc queries) 0 November 28th 05 11:41 AM
Help writting a macro Gerald[_2_] Excel Programming 3 August 11th 05 04:56 AM
Writting a MAcro in Excel Rasoul Khoshravan Azar Excel Programming 1 December 30th 04 01:37 PM
writting a macro for the sum function so I can use it as a keyboard shortcut Frank Kabel Excel Programming 0 July 22nd 04 03:47 PM


All times are GMT +1. The time now is 02:36 AM.

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"