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

[µo°Ý] Àx¦s®æ¦Û°Êupdate

[µo°Ý] Àx¦s®æ¦Û°Êupdate

A

john&ABC01
john&ABC01

D7«Y¤H¤â¿é¤J,§Ú·Q°Ý°Ý,¦pªG§Ú¥ý¦bA1¿é¤JABC01¤§«á  Àx¦s®æ¦Û°ÊÅܦ¨  john&ABC01
À³¸Ó«ç¼Ë¼g?     
    Dim myRng(1 To 1003) As Range
    Dim i             As Long
    For j= 1 To 1003
        
Set john=D7
Set myRng(j) = Cells(j, 1)      
    Next
    Cells.Clear                                 
   myRng(1).Value = "john&ABC01"              
    myRng(2).Value = "john&ABC02""
           
End Sub

¬O³o¼Ë¶Ü?
private sub worksheet_selectionchange(byval target as range)
    target.value = "john" & target.value
end sub
­Y¬O§Ú¦^µª¡A¨Ï±zº¡·N¡A½Ð±zÅý§Úª¾¹D¡I                  
­Y¬O§Úªº¦^ÂСA±z¤´¦³¨ä¥L¨£¸Ñ¡A¤]½Ð±z¤£¶Þ«ü±Ð¡I

TOP

¬Oªº,¤µ¤Ñ¤u§@¤@¤Ñ¤ñ¸û²Ö......
§Ú¬O»¡

D7¬O·|§ïÅܪº ¤µ¤Ñ¬OD7=JOHN
©ú¤Ñ¥i¯à¬OD7=PETER
¦pªG.A5¿é¤JABC01,A5Àx¦s®æ¬O§_¥i¥H¦Û°ÊÅܦ¨JOHNABC01

TOP

·íµM§Ú¥i¥H ¥HEXCEL¤½¦¡ A10="D7"&"A5",¦ACOPY¥hA5¤£¹L³o¼Ë´N¤ñ¸û·Ð.

TOP

¥»©«³Ì«á¥Ñ victorl ©ó 2010-6-5 02:44 ½s¿è

¦^´_ 6# john2006168

°Ñ¦Ò¤@¤U
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address <> "$D$7" And InStr(Target.Value, Range("D7").Value) = 0 Then Target.Value = [D7] & Target.Value
End Sub
»¡©ú:
1. Target.Address <> "$D$7"      D7Àx¦s®æÅܧ󤣯àIJµoWorksheet_Change¨Æ¥ó
2. InStr(Target.Value, Range("D7").Value) = 0     ÁקK­«½ÆIJµoWorksheet_Change¨Æ¥ó
3. °£D7Àx¦s®æ¤§¥~¥u­n¤º®eÅܧ󧡷|¨Ì  ¼Ó¥Dªº»Ý¨DÅܧ󤺮e

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-6-5 14:15 ½s¿è

¦^´_ 9# victorl
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. If Not Target.Address Like "$A$*" Then Exit Sub '¤£¬O¦bAÄæ¿é¤J´N°h¥X
  3. Application.EnableEvents = False 'Ãö³¬Ä²µo¨Æ¥óµ{§Ç
  4.     Target = [D7] & Target
  5. Application.EnableEvents = True '¶}±ÒIJµo¨Æ¥óµ{§Ç
  6. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 10# Hsieh


    ·PÁ  Hsieh¤j¡A¨ü±Ð¤F¡C

TOP

If Not Target.Address Like "$A$*" Then Exit Sub '¤£¬O¦bAÄæ¿é¤J´N°h¥X
Hsieh µoªí©ó 2010-6-5 09:01

¤@¼Ëªº®ÄªG  If Target.Column <> 1 Then Exit Sub '¤£¬O¦bAÄæ¿é¤J´N°h¥X

TOP

¦^´_ 14# john2006168


    ¬O«ç¼Ë¤£¦æ?¬O¤£¯à²MªÅ¶Ü?
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. If Not Target.Address Like "$A$*" Or Target = "" Then Exit Sub '¤£¬O¦bAÄæ¿é¤J´N°h¥X
  3. Application.EnableEvents = False 'Ãö³¬Ä²µo¨Æ¥óµ{§Ç
  4.     Target = [D7] & Target
  5. Application.EnableEvents = True '¶}±ÒIJµo¨Æ¥óµ{§Ç
  6. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

    ¬O¥i¥H,¤£¹L¦pªG¦³delete´N¤£¦æ¤F.   ¬O§R°£Àx¦s®æ¶Ü? ¬O·|¦³°ÝÃD
john2006168 µoªí©ó 2010-6-5 23:03

¬OÀx¦s®æ="" ¶Ü?
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. If Target.Column <> 1 Then Exit Sub '¤£¬O¦bAÄæ¿é¤J´N°h¥X
  3. Application.EnableEvents = False 'Ãö³¬Ä²µo¨Æ¥óµ{§Ç
  4. If Target <> "" Then Target = [D7] & Target
  5. Application.EnableEvents = True '¶}±ÒIJµo¨Æ¥óµ{§Ç
  6. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD