Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Check cell address for double alpha characters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rick S. - 23 Jan 2008 01:33 GMT
Hmmm.  I have posted this two times now and they do not show up in this NG
(1-10+ hours past)!?  "Alpha Numeric Help" and "Alpha/Numeric help"???

I retrieve cell addresses and manipulate them to create ranges, I have run
into a problem when the cell address has double alpha characters, example
"AA23".  In my code below I should get a range of "C5 through "AA23", due to
the double alpha characters in "AA23" I get a range of "C5 through A23".
My true used range is "A1" through "AA23".
Based on my code below, how can I handle ranges with double alpha characters?

'======
       'Begin FindCellRange=====================================
       Dim x As Long, SRng As Range, Rcount As Long
       Dim sRange
       Dim sRow As String
       Dim sRow2 As String

       Set SRng = ActiveSheet.UsedRange
       Rcount = SRng.Rows.Count
       For x = Rcount + SRng.Row To 1 Step -1
           If Application.CountA(SRng.Rows(x)) <> 0 Then Exit For
       Next x
       'MsgBox "First empty row is " & SRng.Rows(x + 1).Address(0, 0) 'for
testing value
       sRow = Right(SRng.Rows(x + 1).Address(0, 0), 3)
       sRow = Replace(sRow, ":", "")
       If Len(sRow) = "2" Then
           sRow2 = Left(sRow, 1)
           'MsgBox "Len(sRow2) = ""2"" " & sRow2 'for testing
       Else
           If Len(sRow) = "3" Then 'double alpha characters fail, IE:
address "AA23". 01.20.08
               sRow2 = Left(sRow, 2)
               sRow2 = Left(sRow2, 1)
               'MsgBox "Len(sRow2) = ""3"" " & sRow2 'for testing
           End If
       End If
       'End FindCellRange=======================================
'======

Signature

Regards

VBA.Noob.Confused
XP Pro
Office 2007

This time, I coppied this entire post to a text file, including topic and
discussion Group.

Dave Peterson - 23 Jan 2008 02:17 GMT
There have been problems with posts showing up--but see your earlier post.

> Hmmm.  I have posted this two times now and they do not show up in this NG
> (1-10+ hours past)!?  "Alpha Numeric Help" and "Alpha/Numeric help"???
[quoted text clipped - 45 lines]
> This time, I coppied this entire post to a text file, including topic and
> discussion Group.

Signature

Dave Peterson

Rick S. - 23 Jan 2008 14:19 GMT
So, it's just a waiting game....Then...
I thought it was my PC after installing VB6.

I will follow up per your suggestion.
(For those who also want to follow up or reply)

http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.excel.programming&mid=e88a8e1e-0033-4421-85d4-0b256bb485d7&sloc=en-us

Signature

Regards

VBA.Noob.Confused
XP Pro
Office 2007

> There have been problems with posts showing up--but see your earlier post.
>
[quoted text clipped - 47 lines]
> > This time, I coppied this entire post to a text file, including topic and
> > discussion Group.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.