- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 14
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-6
|
¦^´_ luhpro
¤j¤j§Úªº½T¬On´¡¤J¤@¨Ç¸ê®Æ¨ì¥Ø«eªº¸ê®Æ§Ç¦C¤¤ ...
a31075ha µoªí©ó 2013-11-26 01:37
¨Ì§Aªº»Ý¨D«¼gµ{¦¡¦p¤U:
¥H¤Uµ{¦¡©ñ¦b Module- Public bOK As Boolean
- Public rTar As Range
½Æ»s¥N½X ¥H¤Uµ{¦¡©ñ¦bn´¡¤J¸ê®ÆªºSheet- Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
- Set rTar = Target
- ufMain.Show
- If bOK Then Cancel = True
- End Sub
½Æ»s¥N½X ¥H¤Uµ{¦¡©ñ¦b Module (§ó¦W¬° ufMain, «Ø¨âÓTextBox ¤À§O©R¦W¬° tbColG »P tbColO, «Ø¨âÓ Buttom ¤À§O©R¦W¬° cbCancel »P cbOK )- Private Sub cbCancel_Click()
- bOK = False
- ufMain.Hide
- End Sub
- Private Sub cbOK_Click()
- Dim lRow&, lRows&, lI&
- Dim arData
-
- bOK = True
- If tbColO.Text = "" Then tbColO.Text = tbColG.Text
- With rTar.Parent
- icol = 7
- arData = Split(tbColG.Text, Chr(13) & Chr(10))
- lRows = UBound(arData, 1)
- lRow = rTar.Row
- .Range(.Cells(lRow, icol), .Cells(Rows.Count, icol).End(xlUp)).Copy .Cells(lRow + lRows + 1, icol)
- .Range(.Cells(lRow, icol), .Cells(lRow + lRows, icol)) = ""
- .Cells(lRow, icol).Resize(lRows + 1) = Application.Transpose(arData)
-
- icol = 15
- arData = Split(tbColO.Text, Chr(13) & Chr(10))
- lRows = UBound(arData, 1)
- lRow = rTar.Row
- .Range(.Cells(lRow, icol), .Cells(Rows.Count, icol).End(xlUp)).Copy .Cells(lRow + lRows + 1, icol)
- .Range(.Cells(lRow, icol), .Cells(lRow + lRows, icol)) = ""
- .Cells(lRow, icol).Resize(lRows + 1) = Application.Transpose(arData)
-
- With ufMain
- .tbColG.Text = ""
- .tbColO.Text = ""
- .Hide
- End With
- End With
- End Sub
½Æ»s¥N½X IJµo¤è¦¡¬° :
1. ¥ô·N Mark Àx¦s®æ¨Ã¹ï Mark ªº°Ï°ì«ö·Æ¹«¥kÁä. (µ{¦¡¥u·|¥Î¨ì²Ä¤@ÓÀx¦s®æªº¦C¸¹, §@¬°´¡¤J¸ê®Æªº°_©l¦C¸¹)
2. µ{¦¡·|¶}¤@Ó UserForm ¤º§t¨âÓ¿é¤J°Ï, ¤À§O¥Î©ó¿é¤Jn´¡¤J ÄæG »P ÄæO ªº¸ê®Æ.
(Yn´¡¤Jªº¸ê®Æ¤£¥u¤@µ§, ½Ð«ö Ctrl+Enter ´«¦C¿é¤J, ¨C¤@¦Cµø¬°¤@µ§¸ê®Æ, ¨âÄ檺¸ê®Æ "µ§¼Æ" ¥i¥H¤£¬Ûµ¥,
Y ÄæOªº¿é¤J°Ï ¥¼¿é¤J¸ê®Æ, «h·|±N ÄæG ªº¸ê®Æ Copy ¹L¥h ÄæO , §Y¨âÄæ³£·|·s¼W¬Û¦Pªº¸ê®Æ.)
3. Y«ö¤U "¨ú®ø" «ö¯Ã, UserForm ·|Ãö³¬, ±µµÛ«ì´_Åã¥Ü¤@¯ë "¦bÀx¦s®æ«ö¥kÁä" «á·|Åã¥Üªº§Ö±¶¦C (§Y¤´¦³«O¯dì¥ý«ö·Æ¹«¥kÁ䪺¥\¯à).
4. Y«ö¤U "½T©w" «ö¯Ã, ·|¥ý°õ¦æ´¡¤J¸ê®Æªº§@·~, ¦AÃö³¬ UserForm, ¥B§Ö±¶¦C§ï¬°¤£Åã¥Ü.
½d¨Òµ{¦¡¦p¤U:
MoveVol-a.zip (13.71 KB)
|
|