- ©«¤l
- 140
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 167
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN 7
- ³nÅ骩¥»
- OFFICE 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-2-26
- ³Ì«áµn¿ý
- 2023-1-30
|
¥»©«³Ì«á¥Ñ donod ©ó 2019-7-8 13:31 ½s¿è
§ä¤FÃö©ó"´¡¤J"ªº¤å³¹¡A¥H¤UÁÙ¬O¹F¤£¨ì®ÄªG¡A¦]¬°n³B²z¼Æ¾Ú«Ü¦h¡AµLªk¤H¤â³B²z¡A§Æ±æ¤j¤j¥X¤â¬Û§U¡A¦AÁÂÁÂ!
ÁÂÁÂGBKEEª©¤jªº´£¨Ñ
http://forum.twbts.com/viewthrea ... ighlight=%B4%A1%A4J
¤u§@ªí¤Wªº¹w³]¨Æ¥ó(Àx¦s®æ¦³§ïÅÜ©ÒIJ°Ê¨Æ¥ó)- Option Explicit
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim Rng As Range
- Set Rng = Range("C45:H50") '«ü©w´¡¤J·sªº¤@¦Cªº½d³ò
-
- If Target.Columns.Count = Rng.Columns.Count Then
- 'Columns.Count:¶Ç¦^½d³ò¤ºÄæ¦ìªºÁ`¼Æ
- 'Rows.Count:¶Ç¦^½d³ò¤º¦C¦ìªºÁ`¼Æ
- If Not Intersect(Rng, Target) Is Nothing And Target.Rows.Count = 1 Then
- 'Intersect ¤èªk ¶Ç¦^ ***[Range ª«¥ó]***¡A¦¹ª«¥ó¥Nªí¨âөΦhÓ½d³ò«Å|ªº¯x§Î½d³ò¡C
- ' Target.Rows.Count = 1 '¤@¦Cªº½d³ò
- If Target.Cells(1).Column = Rng.Cells(1).Column And Target.Cells(Target.Cells.Count).Column = Rng.Cells(Rng.Cells.Count).Column Then
- 'Target.Cells(1).Column = Rng.Cells(1).Column
- '´¡¤J·sªº¤@¦Cªº²Ä¤@ÓÄ渹=«ü©w´¡¤J·sªº¤@¦Cªº½d³òªº²Ä¤@ÓÄ渹
- 'Target.Cells(Target.Cells.Count).Column = Rng.Cells(Rng.Cells.Count).Column
- '´¡¤J·sªº¤@¦Cªº³Ì«á¤@ÓÄ渹 = «ü©w´¡¤J·sªº¤@¦Cªº½d³òªº³Ì«á¤@ÓÄ渹
- MsgBox Target.Address
- End If
- End If
- End If
- End Sub
½Æ»s¥N½X http://forum.twbts.com/viewthread.php?tid=21219&highlight=%B4%A1%A4J- Option Explicit
- Sub Ex()
- Dim A As Range, B As Variant, i As Integer
- For Each A In Range("A1", Range("A1").End(xlDown)) 'A1 ©¹¤U¨ì³Ì«á¤@µ§¸ê®Æ
- B = ""
- For i = 1 To Len(A)
- If Mid(A, i, 1) Like "[A-Z]" Then B = IIf(B = "", Mid(A, i, 1), B & "," & Mid(A, i, 1))
- '§ä¨ì¤j¼gªº¦r¥À ¾É¤JÅܼÆ
- Next
- If B <> "" Then '¦³§ä¨ì¤j¼gªº¦r¥À
- B = Split(B, ",") '§ä¨ì¤j¼g¦r¥Àªº°}¦C
- For i = 0 To UBound(B)
- A = Replace(A, B(i), " " & B(i)) '¥[¤JªÅ®æ
- Next
- Do While InStr(A, Space(2)) '¥]§t¦³¨â®æªºªÅ¥Õ¦r¤¸
- A = Replace(A, Space(2), Space(1)) '®ø°£ ¨â®æªºªÅ¥Õ¦r¤¸ ¬°¤@®æªºªÅ¥Õ¦r¤¸
- Loop
- End If
- Next
- End Sub
½Æ»s¥N½X |
|