View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Striker Striker is offline
external usenet poster
 
Posts: 55
Default Grab the right please

I have a column with numbers in it, as long as 15 in length. I want to grab
just the right two and add them to a variable, then move to the next record
and do the same.

The number is in column "K"

It's been many years since i worked with VBA, and 2007 seems a new animal.
Since the number in column K can be 10 or up to 15 in length, what Can I use
to grab the right two numbers in the string? Here is what I have so far,
just need to grab column "K" right two numbers and add them to a variable
counter if 01 add to this counter, if 02 add to this counter etc. Can only
go be one of 20 combinations of 01 - 20.

BTW Column K is formatted as a string.

Sub CountThese()

Dim lLastRow As Long

Dim rRange, rCell As Range

Dim iNum As Integer

lLastRow = Cells(Rows.Count, "A").End(xlUp).Row

txtRecordCount = lLastRow

Set rRange = Range("K2" & lLastRow)

For Each rCell In rRange.Cells



End Sub