View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default Extracting the column letter and row number

Hi Todd,

Todd Huttenstine wrote:
What code will extract only the column letter and then row
number from the below sample data?


Hey Frank thanks for the response, however the value
Sheet1!$AC$108 is stored in a variable in a userform
module. How would I extract from this?


These functions may work for you:

Public Function glGetRowNumber(rsAddress As String) As Long
On Error Resume Next
glGetRowNumber = Range(rsAddress).Row
On Error GoTo 0
End Function

Public Function gsGetColLetter(rsAddress As String) As String
On Error Resume Next
gsGetColLetter = Split(Range(rsAddress _
).Address(True, False), "$")(0)
On Error GoTo 0
End Function

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]