PC Review


Reply
Thread Tools Rate Thread

Check cell address for double alpha characters

 
 
Rick S.
Guest
Posts: n/a
 
      23rd Jan 2008
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=======================================
'======

--
Regards

VBA.Noob.Confused
XP Pro
Office 2007

This time, I coppied this entire post to a text file, including topic and
discussion Group.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      23rd Jan 2008
There have been problems with posts showing up--but see your earlier post.

Rick S. wrote:
>
> 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=======================================
> '======
>
> --
> 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
 
Reply With Quote
 
Rick S.
Guest
Posts: n/a
 
      23rd Jan 2008
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/comm...5d7&sloc=en-us
--
Regards

VBA.Noob.Confused
XP Pro
Office 2007



"Dave Peterson" wrote:

> There have been problems with posts showing up--but see your earlier post.
>
> Rick S. wrote:
> >
> > 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=======================================
> > '======
> >
> > --
> > 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
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to format a cell to keep alpha characters only? Crankn Microsoft Excel Misc 2 29th Jan 2010 04:54 PM
remove alpha or non-numeric characters from cell mmanis Microsoft Excel Misc 8 7th Aug 2009 02:39 AM
Need to add figures based on alpha characters in the same cell Frustrated in Iowa Microsoft Excel Worksheet Functions 10 13th Nov 2008 09:16 PM
Can you ID a cell that has both Alpha AND Numeric characters? =?Utf-8?B?UGhpbA==?= Microsoft Excel Worksheet Functions 5 18th Apr 2006 09:32 PM
Check for Alpha characters TimE Microsoft Excel Misc 4 10th Nov 2005 12:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 PM.