1."在输入过程中在文本框中单击或双击,EXCEL出错关闭。“该现象我好象,没发现请楼主详细说明一下。 2.”数据表中Worksheet_Change事件出错。见代码说明。“可按下法解决: Private Sub Worksheet_Change(ByVal Target As Range) Dim Cell As Range If Target.Column = 1 Then
Columns("G:G").Clear '清除原内容
Columns("H:H").Clear '清除原内容
Columns("I:I").Clear '清除原内容
'产生不重复名称列G列
Columns("A:A").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("G1"), Unique:=True '高级筛选
'形成拼音辅助列H\I列
For Each Cell In Range("G2:G1000")
strText = Cell.Value
STRLEN = Len(strText)
TText = ""
TTEext = ""
If STRLEN = 0 Then Exit Sub
For I = 1 To STRLEN
TEMP = Asc(Mid$(strText, I, 1))
If TEMP > 255 Or TEMP < 0 Then
TText = TText & PinYin(Mid$(strText, I, 1))
TTEext = TTEext & Mid$(strText, I, 1)
Else
TText = TText & LCase(Mid$(strText, I, 1))
TTEext = TTEext & LCase(Mid$(strText, I, 1))
End If
Next I
'Stop
Cells(Cell.Row, 8).Value = TText
Cells(Cell.Row, 9).Value = TTEext
Next Cell
End If End Sub
|