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

¦p¦ó¸g¥ÑVBªº«ö¶s ¥Ñ¤@­ÓEXCELÀɮ׸ê®Æ¶×¤J¦Ü¥t¤@EXCEL

¦p¦ó¸g¥ÑVBªº«ö¶s ¥Ñ¤@­ÓEXCELÀɮ׸ê®Æ¶×¤J¦Ü¥t¤@EXCEL

·Q½Ð°Ý¤@¤U°ª¤â­Ì


¤µ¤Ñ¦bEXCEL1.xls  ·s¼W¤F¤@­ÓCOMMAND

ÂIÀ»«á½T»{¤J®|«á(  ¬°¥t¤@­ÓxlsÀÉ :EX:  EXCEL2.xls )

´N¯à±NEXCEL2.xls¸Ìªºªí®æ¸ê®Æ¶K¦ÜEXCEL1.xls

·Q½Ð°Ý¤@¤U VBªº¥¨¶°­n«ç»ò¼g·|¤ñ¸û¦n  

³Â·Ð¦U¦ì°ª¤â¸Ñµª¤F>"<
WOW

³o¬O§Ú´ú¸Õªºcode¦ý¦³¿ù»~
  1. Private Sub ´ú¸Õ()
  2. Dim Source As String, Ar()
  3.       Source = application.run(Activeworkbook.Name&"!´ú¸Õ")
  4.       With Workbooks.Open(Source)
  5.         Ar = .Sheets(1).Range("A1:D65536").value
  6.         .Close
  7.     End With
  8.     With ThisWorkbook.Sheets("´ú¸Õ").Range("A1").Resize(UBound(Ar), UBound(Ar, 2))
  9.         .value = Ar
  10.         .Name = "´ú¸Õ"
  11.      End With

  12.     MsgBox "´ú¸Õ¸ê®Æ¶×¤J¦¨¥\"
  13. End Sub
½Æ»s¥N½X
©Î¬O¥i§_¨Ï¥Î¦b¸ê®Æªí¤W³]©w¤@­ÓÀx¦s®æªº¦WºÙ¬°test
µM«áÀ³¥Î³o­Ó¦WºÙ ¥i¥H§âÀɮ׶פJ¶i¨Ó

TOP

¦^´_ 13# white5168
ÁÂÁ§Aªº«Øij¡A¤w­×¥¿¦^¨Ó
¦^´_ 11# GBKEE
¤S¦³­ÓºÃ°Ý

­Y¤£­n¨Ï¥Îvb«ö¶s

ª½±µÀ³¥ÎÀɮצW¦r(¦b¦P­Ó¸ê®Æ§¨¤U)

´N¥i¥H§â¸ê®Æ¶×¤J

³o¸Ó«ç»ò­×§ï©O?

ex:ÀɮצWºÙ¬°==>´ú¸Õ.xlsx

TOP

¤£«Øij¨Ï¥ÎUsedRange¡A¦pªG¹J¨ì¦³ªÅ¤@¤j¬qªºÀx¦s®æ¡A¨º¸ê®Æ´NµLªk§¹¾ã¶×¥X

TOP

¦^´_ 11# GBKEE


·PÁÂG¤jªº¤j¤O¬Û§U
§Ú¬Q¤Ñ¦³¸Õ¹L§A¤§«e¶Kªºµ{¦¡½X
  1. Private Sub Data_Click()
  2. Dim Source As String, Ar()
  3.     Source = Application.GetOpenFilename
  4.     With Workbooks.Open(Source)
  5.         Ar = .Sheets(1).Range("A1:BN65536").Value
  6.         .Close
  7.     End With
  8.     With ThisWorkbook.Sheets("data").Range("A1").Resize(UBound(Ar), UBound(Ar, 2))
  9.         .Value = Ar
  10.         .Name = "data"
  11.      End With
  12.     End Sub
½Æ»s¥N½X
¤¤¶¡§Úª½±µÅª¨ú¤§«eÀÉ®×¥þ³¡Àx¦s®æ¤º®e
²{¦b§ï¦¨
  1. Private Sub Data_Click()
  2. Dim Source As String, Ar()
  3.     Source = Application.GetOpenFilename
  4.      With Workbooks.Open(Source)
  5.         Ar = .Sheets(1).UsedRange.Value
  6.         .Close
  7.     End With
  8.     With ThisWorkbook.Sheets("data").Range("A1").Resize(UBound(Ar), UBound(Ar, 2))
  9.         .Value = Ar
  10.         .Name = "data"
  11.      End With
  12. End Sub
½Æ»s¥N½X
±qRange("A1:BN65536")§ï¬°UsedRange
³o­Ó¤èªk§Ö¦h¤F
¦³¦¨¥\°õ¦æ ¯uªº«Ü·PÁ§A!!!!!

TOP

¦^´_ 10# Changbanana
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Source As String, Ar()
  4.     Source = Application.GetOpenFilename
  5.     With Workbooks.Open(Source)
  6.         Ar = .Sheets(1).UsedRange.Value
  7.         .Close
  8.     End With
  9.     With ThisWorkbook.Sheets("data").Range("A1").Resize(UBound(Ar), UBound(Ar, 2))
  10.         .Value = Ar
  11.         .Name = "Data"
  12.         .Select
  13.     End With
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 7# GBKEE [/

­è¤§«e¦b¤»¼Ó¦^¿ù¤F
À³¸Ó¬O­n¦^ÂФG¼Óªºµ{¦¡
§Úªí¹Fªº¨S¦³«Ü²M·¡©êºp

§Úªº·N«ä¬O(°ÝÃD):

¤w¦bEXCEL1.xls  ·s¼W¤F¤@­ÓCOMMAND

ÂIÀ»«á½T»{¤J®|«á(  ¬°¥t¤@­ÓxlsÀÉ :EX:  EXCEL2.xls )

´N¯à±NEXCEL2.xls¸Ìªº¥þ³¡¸ê®Æ(¥u¦³¤@­Ó¤u§@ªí¸ê®Æ½d³ò¨S­­¨î)¶K¦Ü¤u§@ªí¦WºÙ©T©w¬°'data'ªºEXCEL1.xls

------------------------------------------------
´ú¸Õ§¹¤G¼Óªºµ{¦¡«á

EXCEL2.xls¸Ìªº¥þ³¡¸ê®Æ¬O¥þ³¡¶K¦ÜEXCEL1.xls¤F

¦ý¬O³s¤u§@ªíªº¦WºÙ¤]¶K¹L¥h¤F

¦]EXCEL2.xls ªº¤u§@ªíªº¦WºÙ¬O·|ÀHµÛÀx¦s¤é´Á¦Ó§ïÅÜ
¦ÓEXCEL1.xls¸Ìªº¤u§@ªí¦³ÃB¥~°µ¥¨¶°
¤U¦C¬O¦³Ãö¦bEXCEL1.xls¸Ì¼g¨ìªºµ{¦¡½X
  1. Sheets("¤u§@ªí1").Select
  2. Arr = Range([data!A2], [data!A65536].End(xlUp)(1, 65))
½Æ»s¥N½X
¦]¬°³o¼Ë¬G»Ý­n«ü©w¤u§@ªíªº¦WºÙ
³o¼Ë¥¨¶°¤~¥i¨Ï¥Î

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2016/9/7 15:23): Ar = .Sheets(1).Range("A1:C10").Value

¦^´_ 7# GBKEE
  1. Sub XX()
  2.     Dim Source As String, Ar()
  3.     Source = Application.GetOpenFilename
  4.     With Workbooks.Open(Source)
  5.           Ar = .Sheets(1).Value
  6.          .Close
  7.     End With
  8.     With ThisWorkbook.Sheets(1)
  9.         .Value = Ar
  10.         .Name = "Data"
  11.         .Select
  12.     End With
  13. End Sub
½Æ»s¥N½X
¦bAr = .Sheets(1).Value ¥X¤F°ÝÃD

TOP

¦^´_ 7# GBKEE


·PÁ°ª¤âªºµªÂÐ~

­Y¸ê®Æ¨S¦³­­©w½d³ò~¬O¾ã­Ó¤u§@ªí½Æ»s©O

¨º³o¼Ë¸Ó«ç»ò§ï


ÁÂÁ±z~
(¥Ø«e¥¿¦b¾Ç²ßvba¤¤©Ò¥H¦³¦n¦h°ÝÃD@@

TOP

¦^´_ 6# Changbanana
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub XX()
  3.     Dim Source As String, Ar()
  4.     Source = Application.GetOpenFilename
  5.     With Workbooks.Open(Source)
  6.         Ar = .Sheets(1).Range("A1:C10").Value
  7.         .Close
  8.     End With
  9.     With ThisWorkbook.Sheets(1).Range("D2").Resize(UBound(Ar), UBound(Ar, 2))
  10.         .Value = Ar
  11.         .Name = "Data"
  12.         .Select
  13.     End With
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤H¥Í³Ì¤jªº¦¨´N¬O±q¥¢±Ñ¤¤¯¸°_¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD