写一个excel的vba逻辑是找到H列单元格中的第二个英文字符并将其复制到J列
Sub FindAndCopy()
Dim lastRow As Long
Dim i As Long
Dim cellValue As String
Dim secondLetter As String
lastRow = ActiveSheet.Cells(Rows.Count, "H").End(xlUp).Row
For i = 1 To lastRow
cellValue = ActiveSheet.Range("H" & i).Value
secondLetter = Mid(cellValue, 2, 1)
If secondLetter Like "[A-Za-z]" Then
ActiveSheet.Range("J" & i).Value = secondLetter
End If
Next i
End Sub
原文地址: https://www.cveoy.top/t/topic/biOw 著作权归作者所有。请勿转载和采集!