【VBA】文字列から、指定文字の位置を取得する
記事更新日:2022-11-01

指定文字の位置を取得して、その番号を返す
' -----------------------------------------------------------------------
' 機能 : 文字列から指定文字の位置を取得して返す
' 引数 : str:元の文字列/char:位置を知りたい文字
' -----------------------------------------------------------------------
Public Function GetCharPos( _
ByVal str As String, _
ByVal char As String) As Long
GetCharPos = InStrRev(str, char)
End Function
関連記事
2022-11-01
編集後記:
この記事の内容がベストではないかもしれません。