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

[µo°Ý] ½Ð°Ý¦U¦ì¤j¯«¦p¦ó²¤Æ³o­Ó

[µo°Ý] ½Ð°Ý¦U¦ì¤j¯«¦p¦ó²¤Æ³o­Ó

§Ú»Ý­nB6®æ¤l¤º®e¥h´M§ä¹ïÀ³ªºÀɮ׶}±Ò¨Ï¥Î
¥Ø«eµ{¦¡½X¦p¤U¡A¦]¤Ó¦hºØÃþ¥­ªO¨Ï¥Î·|­t²ü¤£¤F¡A
ÁÂÁÂ
  1. Dim myFileName As String
  2. myFileName = Range("B6")
  3. '300
  4. If Range("B6") = "CJ" Then
  5.   myFileName = ThisWorkbook.Path & "\paper\300\XZU600\CJ\CJ.xlsm"
  6.   Workbooks.Open Filename:=myFileName, UpdateLinks:=True
  7. End If
  8. If Range("B6") = "CK" Then
  9.   myFileName = ThisWorkbook.Path & "\paper\300\XZU600\CK\CK.xlsm"
  10.   Workbooks.Open Filename:=myFileName, UpdateLinks:=True
  11. End If
  12. If Range("B6") = "CL" Then
  13.   myFileName = ThisWorkbook.Path & "\paper\300\XZU600\CL\CL.xlsm"
  14.   Workbooks.Open Filename:=myFileName, UpdateLinks:=True
  15. End If
  16. If Range("B6") = "CM" Then
  17.   myFileName = ThisWorkbook.Path & "\paper\300\XZU600\CM\CM.xlsm"
  18.   Workbooks.Open Filename:=myFileName, UpdateLinks:=True
  19. End If
  20. If Range("B6") = "CN" Then
  21.   myFileName = ThisWorkbook.Path & "\paper\300\XZU600\CN\CN.xlsm"
  22.   Workbooks.Open Filename:=myFileName, UpdateLinks:=True
  23. End If
  24. If Range("B6") = "CP" Then
  25.   myFileName = ThisWorkbook.Path & "\paper\300\XZU630\CP\CP.xlsm"
  26.   Workbooks.Open Filename:=myFileName, UpdateLinks:=True
  27. End If
  28. If Range("B6") = "CQ" Then
  29.   myFileName = ThisWorkbook.Path & "\paper\300\XZU640\CQ\CQ.xlsm"
  30.   Workbooks.Open Filename:=myFileName, UpdateLinks:=True
  31. End If
  32. If Range("B6") = "CR" Then
  33.   myFileName = ThisWorkbook.Path & "\paper\300\XZU640\CR\CR.xlsm"
  34.   Workbooks.Open Filename:=myFileName, UpdateLinks:=True
  35. End If
  36. If Range("B6") = "CS" Then
  37.   myFileName = ThisWorkbook.Path & "\paper\300\XZU640\CS\CS.xlsm"
  38.   Workbooks.Open Filename:=myFileName, UpdateLinks:=True
  39. End If
½Æ»s¥N½X

¦^´_ 4# ikboy
ÁÂÁ«ü¾É
©êºp¦]¸Ó¬O§Ú»¡ªº¤£°÷¸Ô²Ó
§Úªº¸ê®Æ§¨¦p¹Ï

¥¼1¦W.png

    ¥Ø«e¬O¤w³æ¤@ªº¥h§PÂ_§ì¨ú¤£¹LÀɮפӦh·|¾É­P¥­ªO¹q¸£­t²ü¤£¤F
¦³§ó¦nªº ¤è¦¡¥h¶}±Ò§Ú»Ý­nªºÀɮצA½Ð«ü¾É
ÁÂÁÂ

TOP

2# ¤w¸gOK¤F, ¥H¤U°N¬O¨¾¤î¤@¤U¡C
  1. Sub zz()
  2. Dim myFileName As String, s$
  3. s = "JKLMNPQRS"
  4. For i = 1 To Len(s)
  5.     If [B6] = "C" & Mid(s, i, 1) Then
  6.         s = "C" & Mid(s, i, 1)
  7.         Workbooks.Open ThisWorkbook.Path & "\paper\300\XZU600\" & s & "\" & s & ".xlsm", 1
  8.     End If
  9. Next
  10. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# jcchiang

ÁÂÁÂJ¤j«ü¾É
¥i¬O§Úªº¸ê®Æ§¨¸ô®|¤£¥u¤@­Ó
:L :L

TOP

¦^´_ 1# john711101

ª½±µ±NÄæ¦ì­È®M¤JmyFileName¤º,´N¤£¥Î°µ§PÂ_
myFileName = ThisWorkbook.Path & "\paper\300\XZU600\" & Range("B6") & "\" & Range("B6") & ".xlsm"

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤H¤£©È¿ù¡A´N©È¤£§ï¹L¡A§ï¹L¨Ã¤£Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD