我有以下代码用于在Userform上查看图像,具体取决于Range("A1:A200")
中的Target.Value
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyPath As String
Dim MyPic As String
MyPath = "C:\Users\Public\Pictures\Sample Pictures\"
On Error GoTo error_handler:
If Intersect(Target, Range("a1:a200")) Is Nothing Then Exit Sub
MyPic = Target.Value & ".jpg"
UserForm2.Image1.Picture = LoadPicture(MyPath & MyPic)
UserForm2.Show vbModeless
error_handler:
Exit Sub
End Sub
我遇到此脚本的问题是我无法使用箭头键更改活动单元格。
我该如何解决这个问题?