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

[µo°Ý] ¸ê®Æ¦X¨Ö«á¥[¨ì°Å¶Kï

[µo°Ý] ¸ê®Æ¦X¨Ö«á¥[¨ì°Å¶Kï

¥»©«³Ì«á¥Ñ joslau ©ó 2013-9-30 17:17 ½s¿è

§Ú·Q¨Ï¥ÎªÌ¦Û¦æ¿ï¨ú©Ò»Ý¸ê®Æ«á
¦A±N¿ï¨ú¸ê®Æ¦X¨Ö
¦ý¤¤¶¡¥[¤@­Ó³r¸¹

401234567
412345678
423456789
434567891

§Y¨Ï¥ÎªÌ¿ï¨ú¤F¥H¤W¸ê®Æ«áÅܦ¨¥H¤U³o¼Ë¥[¨ì°Å¶Kï :

401234567,412345678,423456789,434567891
¦æ¼Æ¨C¦¸¤]¬O¤£¤@¼Ëªº
EXCEL¤º®e¥i¥H¤£ÅÜ

³o¼Ë°µ»Ý­nVBA¶Ü?

¥ýÁÂ!

¦^´_ 1# joslau
  1. Sub Ex()
  2.   Dim rngSelect As Range, sMerge As String
  3.   
  4. SELECT_RANGE_AGAIN:
  5.   On Error Resume Next
  6.   Set rngSelect = Application.InputBox(prompt:="½Ð¿ï¾Ü³æ¦C½d³ò©Î³æÄæ½d³ò", Default:=Selection.Address, Type:=8)
  7.   On Error GoTo 0
  8.   If rngSelect Is Nothing Then Exit Sub
  9.   rngSelect.Select
  10.   
  11.   With rngSelect
  12.     If .Rows.Count = 1 And .Columns.Count = 1 Then  '³æ®æ
  13.       sMerge = rngSelect.Value
  14.     ElseIf .Rows.Count = 1 And .Columns.Count > 1 Then  '³æ¦C
  15.       sMerge = Join(Application.Transpose(Application.Transpose(rngSelect.Value)), ",")
  16.     ElseIf .Rows.Count > 1 And .Columns.Count = 1 Then  '³æÄæ
  17.       sMerge = Join(Application.Transpose(rngSelect.Value), ",")
  18.     Else
  19.       GoTo SELECT_RANGE_AGAIN
  20.     End If
  21.   End With
  22.   
  23.   With New DataObject '»Ý¤Þ¥Î Microsoft Form Object Library
  24.     .SetText sMerge
  25.     .PutInClipboard
  26.   End With
  27. End Sub
½Æ»s¥N½X

TOP

½Ð°Ý stillfish ¤j¤j
Excel 2010 ª©¨S¦³ Microsoft Form Object Library ¶Ü?
¤Þ¥Î¤¤«ç¨S¦³ ¿ï¶µ

TOP

¦^´_ 3# wufonna
´¡¤J¤@­ÓªÅ¥Õªí³æ¡A¦A¬Ý¬Ý¬O§_¦Û°Ê¤Þ¥Î¤F¡F¦pªGÁÙ¬O¨S¦³¡A¤â°ÊÂsÄý¥[¤J C:\windows\system32\FM20.DLL¡C

TOP

·PÁÂ!!!

§Ú¥¿¬ã¨s¤£¥Î¼u¥Xmsgboxªº¥i¦æ©Ê

TOP

¬ã¨s§¹~~~

§Ú±N
  1.   Set rngSelect = Application.InputBox(prompt:="½Ð¿ï¾Ü³æ¦C½d³ò©Î³æÄæ½d³ò", Default:=Selection.Address, Type:=8)
½Æ»s¥N½X
§ï°µ
  1.   Set rngSelect = Selection
½Æ»s¥N½X
²{¦b¤£¥ÎÅã¥ÜinputBox¤F

¦A¦¸·PÁÂstillfish00! m(_ _)m

TOP

ÁÂÁ stillfish ¤j ¥[¤Jªí³æ´N¥i¤F

½Ð°Ý ¤j¤j
¤â°Ê¥[¤J¬O«ü³o¼Ë¶Ü
ThisWorkbook.VBProject.References.AddFromFile "C:\windows\system32\FM20.DLL"
ÁÂÁÂ

TOP

¦^´_ 8# wufonna
§Ú¬O«üVB½s¿è¾¹>¤u¨ã>³]©w¤Þ¥Î¶µ¥Ø>ÂsÄý¡A¦Û¤v¿ï¸ÓÀɮסA¦ý¸ò§A³ocodeÀ³¸Ó¬O¦P¼Ë·N«ä

TOP

        ÀR«ä¦Û¦b : ¤@¥y·Å·xªº¸Ü¡A´N¹³©¹§O¤H¨­¤WÅx­»¤ô¡A¦Û¤v·|ªg¨ì¨â¤Tºw¡C
ªð¦^¦Cªí ¤W¤@¥DÃD