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

[µo°Ý] ¨Ï¥Î FileDialog °ÝÃD [¤w¸Ñ¨M]

[µo°Ý] ¨Ï¥Î FileDialog °ÝÃD [¤w¸Ñ¨M]

¥»©«³Ì«á¥Ñ jimmyhk ©ó 2011-9-14 19:17 ½s¿è

§Ú«Ø¥ß¤F¤@­Óªí³æ, ·í«ö¤F CommandButton2 ¤§«á´N·|¶}¤@­ÓÂsÄý¸ê®Æ§¨ªºª«¥ó,
¥Î§@¿ï¾Ü¸ê®Æ§¨, ¤Î«á§â¿ï¾Ü¤Fªº¸ê®Æ§¨¸ô®|¦s©ñ¨ì Data_Field ªº D24 ¤º,
¤º®e¦p¤U:

Private Sub CommandButton2_Click()
    Dim fd As FileDialog
    Set fd = Application.FileDialog(msoFileDialogFolderPicker)
    If fd.Show = -1 Then MsgBox "²{¦b±NÀx¦s¨ì " & fd.SelectedItems(1) & "/  .  ½Ð«ö½T©wÄ~Äò"

Sheets("Data_Field").Select
Range("D24").Value = fd.SelectedItems(1)  '¦pªG¨Ï¥ÎªÌ¦b FileDialog ¶}±Ò®É¨S¦³«ö½T©w, «ö¤F¨ú®øÁä, ´N·|°±¦b³o¸Ì.   À³«ç»ò¿ì?
Unload ChoiceSaveLocation
End Sub

®@~~~  ©ó¸Ì­±¦A¥[¤@­Ó if case...  um.....  ¦n
¸Õ¤@¤U¥ý~

TOP

¦^´_ 2# GBKEE

³Ì«á§ÚÂà¤F¥t¤@­Ó¤èªk³B²z,
¤£ª¾³o­Ó¦n¤£¦n~
  1. Private Sub CommandButton2_Click()
  2.     Dim fd As FileDialog
  3.     Set fd = Application.FileDialog(msoFileDialogFolderPicker)
  4.     fd.InitialFileName = "d:\"  '¦pªG¥Î®a«ö¨ú®ø´N·|°õ¦æ RunAgain
  5. On Error GoTo RunAgain
  6.     If fd.Show = -1 Then MsgBox "ÀÉ®×±NÀx¦s¨ì " & fd.SelectedItems(1) & "\  , ½Ð«ö½T©wÄ~Äò."

  7. RunAgain:
  8. Select Case Err.Number
  9. Case 5
  10. Unload ChoiceSaveLocation
  11. ChoiceSaveLocation.Show
  12. End Select

  13. Sheets("Data_Field").Select
  14. Range("D24").Value = fd.SelectedItems(1)

  15. If Range("D24") <> Range("G24") Then
  16.     AskChangeDefaultBox.Show
  17.     Else
  18.     Sheets("Input").Select
  19.     Unload ChoiceSaveLocation
  20. End If
  21. Unload ChoiceSaveLocation
  22. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# GBKEE
  1. Private Sub CommandButton2_Click()
  2.     Dim fd As FileDialog
  3.     Set fd = Application.FileDialog(msoFileDialogFolderPicker)
  4.     fd.InitialFileName = "d:\"  '¦pªG¥Î®a«ö¨ú®ø´N·|°õ¦æ RunAgain
  5. On Error GoTo RunAgain
  6.     If fd.Show = -1 Then MsgBox "ÀÉ®×±NÀx¦s¨ì " & fd.SelectedItems(1) & "\  , ½Ð«ö½T©wÄ~Äò."
  7.               '**************³oMsgBox ¦³«ö¨S«ö³£¨S§@¥Î?????**********  <³o¬O¨S¦³¥Îªº, ¥u¬O§@¤@­Ó¤p´£¿ô
  8. Sheets("Data_Field").Select
  9. Range("D24").Value = fd.SelectedItems(1)
  10. If Range("D24") <> Range("G24") Then
  11.     AskChangeDefaultBox.Show
  12.     Else
  13.     Sheets("Input").Select
  14.     Unload ChoiceSaveLocation
  15. End If
  16. Unload ChoiceSaveLocation
  17. Exit Sub
  18. '''''''¤@¯ë³B¸Ì¿ù»~³£·|¸m©óµ{§Ç©³³¡   ''''''' <- ©ú¥Õ
  19. RunAgain:
  20. Select Case Err.Number
  21. Case 5 '  **§Ú´N¬O©È·|¦³¨ä¥L¿ù»~, ©Ò¥H¨M©w¥u¦³ Case 5 ¤~°õ¦æ­«¿ï.  
  22. Unload ChoiceSaveLocation
  23. ChoiceSaveLocation.Show
  24. End Select
  25. Resume          'ªð¦^²£¥Í¿ù»~ªºµ{¦¡½X <- ¦b³o¥[³o¤@¥yªº­ì¦]¬O ?  ¦]¬°²{¦b¦pªG¨Ï¥ÎªÌ¦b«ö¨ú®ø«á¤w·|¦Û°Ê­«·s¦æ¤@¦¸ Unload ChoiceSaveLocation ©M ChoiceSaveLoction.show, ¥[¤Jªº¥Øªº¬O?
  26. End Sub
½Æ»s¥N½X

TOP

¦^´_ 7# GBKEE


®ø¥¢¬O¦³Ãö¿ù»~¤w¸Ñ¨MÁÙ¬Oµ¹¿ù»~°T®§¼u¥X«á¥i¥HÄ~Äò°õ¦æ¨ä¥L¨BÆJ?

TOP

¦^´_ 9# GBKEE


®@~  ©ú¥Õ~  thx~~~

TOP

        ÀR«ä¦Û¦b : ¤Ñ¤W³Ì¬ü¬O¬P¬P¡A¤H¥Í³Ì¬ü¬O·Å±¡¡C
ªð¦^¦Cªí ¤W¤@¥DÃD