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

[µo°Ý] VBA¥t¦s·sÀÉ¥X¿ù

[µo°Ý] VBA¥t¦s·sÀÉ¥X¿ù

§Ú¦³¤@­ÓEXCELÀÉ®×, ¤º¦³¨â­Ó¤u§@ªí, ¨C­Ó¤u§@ªí³£¨Ï¥Î§Ö±¶«ö¶s°õ¦æ¤U¦CªºVBA CODE, ±N¤u§@ªí«ö«ü©w¸ô®|¥t¦s·sÀÉ®×.

°ÝÃD(1) ¬O¦³¨Ç®É­Ô°õ¦æVBA CODE®É, ·|Åã¥Ü¥t¦sÀɤw¸g¦s¦b, ¦ý¨ä¹ê·|¦b«ü©w¸ô®|¤º, ¦Û°Ê¼W¥[¤F¤@¦ó"PATH"ªºFOLDER, ¦A¦bFOLDER ¤º¥t¦s¦WºÙ¬O"FILENAME"ªº¤u§@ªí.  ¤£ª¾¬O§_¨â­Ó¤u§@ªí¦@¥Î¤@­ÓVBA CODE¥X²{°ÝÃD? §Æ±æ½ç±Ð!
°ÝÃD(2) ¦pªG¥t¦s·sÀÉ®×®É, ¤w¦³¬Û¦P¦WºÙÀɮצs¦b,¥i§_­n¨ú®ø¦sÀÉ, §ï¬°¤´µM¦sÀÉ, ¦ý¦Û¦æ¦bÀɮצWºÙ«á¥[¤WV1, V2, V3µ¥, ¦p¦¹Ãþ±À?
  1. Sub activeSave_2c()

  2. Application.ScreenUpdating = False
  3. Dim filename As String, fPath As String
  4. filename = [S2]: fPath = [S3]: If Dir(fPath, vbDirectory) = "" Then MkDir fPath

  5. If Dir(fPath & "\" & filename & ".xlsx") <> "" Then
  6.    MsgBox "«ü©wªº " & filename & ".xlsx ¤w¸g¦s¦b! ¨S¦³°õ¦æ¦sÀÉ": Exit Sub
  7. End If

  8. ActiveSheet.Copy
  9. [A1:G100].Value = [A1:G100].Value
  10. [H:Y].Delete: [A1].Select
  11. ActiveWorkbook.SaveAs filename:=fPath & "\" & filename & ".xlsx"
  12. ActiveWorkbook.Close
  13. MsgBox "¤w¸g·s¼WÀÉ®×": ThisWorkbook.Activate
  14. End Sub
½Æ»s¥N½X

Sub activeSave_2c()
Dim filename As String, fPath As String,k%, km$
Application.ScreenUpdating = False
filename = [S2]: fPath = [S3]
If Dir(fPath, vbDirectory) = "" Then MkDir fPath

for k = 99 to 1 step -1
     km="_V" & format(k, "00")
     If Dir(fPath & "\" & filename & km & ".xlsx") <> "" Then exit for
next k
if k>=99 then msgbox "ÀɮקǸ¹¤w¥Î§¹!!  ":exit sub
km="_V" & format(k+1, "00")

ActiveSheet.Copy
[A1:G100].Value = [A1:G100].Value
[H:Y].Delete: [A1].Select
ActiveWorkbook.SaveAs filename:=fPath & "\" & filename & km & ".xlsx"
ActiveWorkbook.Close
MsgBox "¤w¸g·s¼WÀÉ®×": ThisWorkbook.Activate

TOP

ÀɦW+¤é´Á®É¶¡//§ó²Å¦X¤À¦¸«ØÀÉ

Sub activeSave_3c()
Dim filename As String, fPath As String,k%, km$
Application.ScreenUpdating = False
filename = [S2]: fPath = [S3]
If Dir(fPath, vbDirectory) = "" Then MkDir fPath

km="_V" & format(now, "yymmdd-hhmmss")

ActiveSheet.Copy
[A1:G100].Value = [A1:G100].Value
[H:Y].Delete: [A1].Select
ActiveWorkbook.SaveAs filename:=fPath & "\" & filename & km & ".xlsx"
ActiveWorkbook.Close
MsgBox "¤w¸g·s¼WÀÉ®×": ThisWorkbook.Activate

TOP

¦^´_ 3# ­ã´£³¡ªL


   ¦hÁ«ü¾É:)

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD