ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ©ó¦Û°Ê¥t¦s·sÀÉ®ÉÀˬd¦³Ãö¸ô®|¤Î©ó¦³»Ý­n®É«Ø¥ß¸ê®Æ§¨ [¤w¸Ñ¨M]

[µo°Ý] ©ó¦Û°Ê¥t¦s·sÀÉ®ÉÀˬd¦³Ãö¸ô®|¤Î©ó¦³»Ý­n®É«Ø¥ß¸ê®Æ§¨ [¤w¸Ñ¨M]

¥»©«³Ì«á¥Ñ jimmyhk ©ó 2011-9-23 13:40 ½s¿è

·Q½Ð±Ð§Ú©óºô¤W§ä¨ì¦³ÀˬdÀɮצWªº¦ì¸m©M¦WºÙ¬O§_¥¿½T,
¥H¤Î¥ç¦³¤@¥÷¬OÀˬd¸ê®Æ§¨ªº.

¦ý©ó§Ú¼gªº excel VBA  (§Ú¬Oªì¤ßªÌ) ¤º´N¦æ¤£³q,
¥i§_«ü±Ð¤@¤U?

Dim sa As String
SaveLocation.Show
' (©ó form SaveLocation ¿é¤J¸ô®|«á¦s¨ì Range("D24")

Sheets("data_field").Select
sa = Range("D24").Value
Dim Ex As String
    Sheets("input").Select
    Ex = Range("A23").Value
Sheets(Ex).Select

booknme1 = f1
booknme2 = f2
booknme3 = f3
folda = sa
fname1 = folda & "\" & booknme1
fname2 = folda & "\" & booknme2
fname3 = folda & "\" & booknme3

'  ¥H¤U³o¬q¬°ºô¤W§ä¨ìªº VBA ½X
Dim fso
    CreateObject ("Scripting.FileSystemObject")
'  ³o­Ó¬°¥¦¹w³]ªº¸ô®|
'    If Not (fso.FolderExists("d:\abc")) Then
'  ¦]¬°§Ú·QÀx¦sªº¸ô®|¬O©ó Range("A23") ¨M©w, §Ú¥»·Q§ï¬°³o¥y, ¦ý Excel ¤£¯àµ¹§Ú°õ¦æ
    If Not (fso.FolderExists(folda)) Then
MkDir (folda)
End If

ActiveSheet.Copy
ActiveWorkbook.SaveAs Filename:=fname3
ActiveWorkbook.Close True

ActiveSheet.SaveAs fname1, xlUnicodeText
ActiveSheet.SaveAs fname2, xlUnicodeText


'½Ð°Ý¦³¤èªk¸Ñ¨M³o­Ó°ÝÃD¶Ü?  ÁÂÁÂ

¦^´_ 1# jimmyhk
½Ðªþ¤WÀÉ®× ¬Ý¬Ý§A¦p¦ó®M¥Î­×§ïªº?

TOP

¦^´_ 2# GBKEE


DCB Template v0.7a.rar (52.67 KB)


thx~

TOP

¦^´_ 3# jimmyhk
¦]¬°¬O¦h¼h¥Ø¿ý¡A¥²¶·´`§Ç«Ø¥ß
Set fsd = CreateObject("Scripting.FileSystemObject")
fs = ComboBox1
ar = Split(fs, "\")
If Not fsd.folderexists(fs) Then
fd = ar(0)
For i = 1 To UBound(ar)
fd = fd & "\" & ar(i)
MkDir fd
Next
End If
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# Hsieh


    ÁÂÁ§Aªº¦^ÂÐ.

¦ý§Úµo²{¦³¨â­Ó°ÝÃD,

Set fsd = CreateObject("Scripting.FileSystemObject")
fs = sa   '  ³o¥y°õ¦æ®É¥¦µo¥Í¿ù»~, §Ú§â³o­Ó§ï¬° sa (¤£¥Î combox1 ) ®É´N¥i¥H³q¹L.
ar = Split(fs, "\")
If Not fsd.folderexists(fs) Then
fd = ar(0)
For i = 1 To UBound(ar)
fd = fd & "\" & ar(i)
MkDir fd
Next
End If


¥t¤@­Ó°ÝÃD,
¨Ò¦p§Ú¿é¤J¦sÀɸô®|¬° D:\aa\abc  
¦p­ì¥ý¥À¸ê®Æ§¨©M¤l¸ê®Æ§¨³£¤£¦s¦b®É,
¥¦¥i¥H¥¿±`¦Û¦æ«Ø¥ß¨â­Ó¸ê®Æ§¨,
¦ý¦p d:\aa ¬O¤w¸g¦s¦b, ¦Ó abc ¬O¤£¦s¦b®É,
´N·|©ó mkdir fd °õ¦æ®Éµo¥Í¿ù»~,
§Ú¬O§_­n©ó¥¦«Ø¥ß®É¦A¥[Àˬd«e³¡¥÷ªº¥y¤l?  À³¦p¦ó¥[¤J?

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-8-31 09:01 ½s¿è

¦^´_ 5# jimmyhk

¨º´N¬O­n¦bMKDIR®É°µ§PÂ_
If Not fsd.folderexists(fs) Then
fd = ar(0)
For i = 1 To UBound(ar)
fd = fd & "\" & ar(i)
If Not fsd.folderexists(fd) Then MkDir fd
Next
End If
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 6# Hsieh


®@~~~
§Y¬O­nÀˬd¨â¦¸...
©ú¥Õ
§Ú¦A¸Õ¸Õ~~~

TOP

        ÀR«ä¦Û¦b : µoµÊ®ð¬Oµu¼ÈªºµoºÆ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD