- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2015-1-1 08:19 ½s¿è
DEAR ALL ¤j¤j
1.RANGE("C4:C25") »P RANGE("D425") ¬°´£¨Ñ¸g¿ì¿é¤J¤§½d³ò
1.1 ¨Ò C4¿é¤JA D4¿é ...
rouber590324 µoªí©ó 2014-12-31 13:32
¤@¯ën§i¶D¨Ï¥ÎªÌ°T®§¨Ãµ¥«Ý¨ä¦^ÂÐ(©Î«ö"½T©w"¶s)ªº»Ý¨D,
¥i¥H¨Ï¥Î Msgbox "n§iª¾ªº°T®§" §Y¥i.
¤£¹LÆ[¹î§A¤W¤èªº±Ôz¤º®e,
§Úµo²{§A¦³¦h¦¸±j½Õ "¤@©wn¿é¤J..." n¨D¨Ï¥ÎªÌ¬Ý¨ì°T®§«á¥²¶·°µªº°Ê§@.
¦Ó´«Ó¨¤«×·Q,
Y¤£¼vÅT¨Ï¥ÎªÌ¹ê»Ú§@·~ªº±¡§Î¤U,
§A¥i¥H¦Ò¼{ª½±µ¦bVBAµ{¦¡¤¤¥N´À¨Ï¥ÎªÌ°µ³oӰʧ@.
¨Ò¦p : ·í C5¿é¤JA ®ÉD5¤@©wn¿é¤J1
´N¥Î If [C5] = "A" Then [D5]=1 §Y¥i.
¥t¥~¦b§Aªº±Ôz¤¤:
°²³] [C4][D4] = A1 ®É, ·í C5~C25 ¿é¤J A ®É,¸Ó¦Cªº Dx ´Nn¬° 1
°²³] [C10][D10] = B9 ®É, ·í C11~C25 ¿é¤J B ®É,¸Ó¦Cªº Dx ´Nn¬° 9
°ÝÃD¨Ó¤F, °²³]¨Ï¥ÎªÌ¾Þ§@¤Wz¨â¨BÆJ¤§«á -
1. CxDx ªº¹ïÀ³Ãö«Y¬O§_¥þ³¡(§Y²Ä 4 ¦C ~ ²Ä 25 ¦C)¾A¥Î, ÁÙ¬O¥u¬O©¹¤U¾A¥Î?)
2. Y¦b C5 ¿é¤J B ®É, D5 Åý¤£Åý¨Ï¥ÎªÌ§ï? ÁÙ¬O·Ó¼Ë¥u¯à¿é¤J 9 ?
2.1. °²³]±µ¨ü¨Ï¥ÎªÌקï D5=6 , ¨º¤§«e¤w¸g¿é¤Jªº D10(¬Æ¦Ü¨ä¥L¬Û¦P±¡§Î) ¬O§_¤](³£)n§ï¦¨ 6 ? ¤S¬O§_¥u¬O©¹¤U¾A¥Î?
2.2 °²³]¤£±µ¨ü¨Ï¥ÎªÌקï, ¨º¸U¤@¬O¤§«e¨Ï¥ÎªÌ¿é¤J¿ù»~ªº¸Ü, ¨º¤S¬O§_´£¨Ñ×¥¿ªº¾÷¨î?
¦¹³B¥ý°²³]¥þ³¡¾A¥Î, ¥B«á¥O»\«e¥O.- Dim vD
- Option Explicit
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim sStr$
- Dim rTar As Range
-
- On Error GoTo errWsChg
- With Target
- If .Column = 3 Then ' CÄæ
- If .Offset(, 1) <> "" Then
- sStr = .Text
- vD(CStr(.Value)) = .Offset(, 1)
- Else
- .Offset(, 1) = vD(CStr(.Value))
- End If
- Else ' D Äæ
- If .Offset(, -1) <> "" Then
- sStr = .Offset(, -1).Text
- vD(CStr(.Offset(, -1))) = .Value
- End If
- End If
- For Each rTar In Range([C4], [C25])
- With rTar
- If .Value = sStr And .Offset(, 1) <> "" Then
- Application.EnableEvents = False
- .Offset(, 1) = vD(sStr)
- Application.EnableEvents = True
- End If
- End With
- Next
- End With
-
- On Error GoTo 0
- Exit Sub
- errWsChg:
- Select Case Err.Number
- Case 13 ' «¬ºA¤£²Å¦X
- Set vD = CreateObject("Scripting.Dictionary")
- Resume
-
- Case Else
- Resume Next
-
- End Select
-
- Resume Next
- End Sub
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- With Target
- If Not ((.Row > 3 And .Row < 26) And (.Column > 2 And .Column < 5)) Then
- MsgBox "«D¥i¿é¤Jªº½d³ò(¶È¥i¿ï¾Ü C4 ~ D25), ½Ð«·sÂI¿ï..."
- If .Row > 3 And .Row < 26 Then
- .Offset(, 3 - .Column).Select ' ¦C¦b¥iÅܧó½d³ò¤º,µJÂI±j¨î²¾¨ì CÄæ
- Else
- .Parent.[C14].Select ' ±j¨î²¾¨ì [C14]
- End If
- End If
- End With
- End Sub
½Æ»s¥N½X |
|