- 帖子
- 39
- 主題
- 8
- 精華
- 0
- 積分
- 53
- 點名
- 0
- 作業系統
- WIN7
- 軟體版本
- 2003
- 閱讀權限
- 20
- 註冊時間
- 2013-11-16
- 最後登錄
- 2016-1-30
|
23#
發表於 2013-11-16 01:48
| 只看該作者
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim data As Range, Y As Variant
Application.EnableEvents = False
If Not Intersect(Target, [A1:A10]) Is Nothing Then
' Set data = ['sheet2'!$A$1:B$25]
'Y = Application.VLookup(Target, data, 2, 0)
Y = Application.VLookup(Target, ['sheet2'!$A$1:B$25], 2, 0)
Target.Offset(, 1) = IIf(IsError(Y), "", Y)
End If
Application.EnableEvents = True
End Sub
大大想請問這一段是否有辦法把外框字體顏色也一併帶過來呢??? 感恩....... |
|