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

Excel VBA: Extract Second Letter from Column H to Column J

原文地址: https://www.cveoy.top/t/topic/mKPW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录