Any fast method to parse a string into row & col information

N

Nick

Hi,

Given a string "AC19", any method to split the string into "AC" and
"19", without using string methods?

Thx

Nick
 
K

K Dales

Hard to do anything to a string without using string
methods! (I assume you mean functions).
 
G

Guest

What about the LEFT() and RIGHT() functions? They take a
string expression and get a certain number of charaters
from the left or the right.
 
B

Bernie Deitrick

Nick,

You can use the sub and function below.

HTH,
Bernie
MS Excel MVP

Sub ShowColumnLetter()
Dim myAddress As String
myAddress = "AC19"

MsgBox "Column and row for cell " & myAddress & _
" are " & ColumnLetter(myAddress) & _
" and " & Range(myAddress).Row & "."
End Sub

Function ColumnLetter(myAdd As String) As String
Dim LastColLtr As String
LastColLtr = Range(myAdd).Address
ColumnLetter = Mid(LastColLtr, 2, InStr(2, LastColLtr, "$") - 2)
End Function
 
Top