how do you set a variable in VBA (excel) from a partial cell value?

Im trying to set a variable in VBA in excel by using just a part of a cell.

The cell contains "Number: XXXXXX"
where the X's are the number
I need the number set as a variable without the "number:" part in the variable. I can set the entire cell as a variable, but not part of it. Any idea how to do this?

2009-08-23T22:09:01Z

Sorry, I should have been clearer, The "number" contains alphanumeric charecters. But I see what you did... I'll see if I can change it around.

Thanks alot for your help.

garbo74412009-08-23T21:58:48Z

Favorite Answer

Sub StripText()
Dim i, LastRow, theNum
LastRow = Range("A" & ActiveSheet.Rows.Count).End(xlUp).Row
For i = 1 To LastRow
For j = 1 To Len(Cells(i, "A"))
If Asc(Mid(Cells(i, "A"), j, 1)) = 58 Then
theNum = Mid(Cells(i, "A"), j + 2, _
Len(Cells(i, "A")) - (j - 1))
Cells(i, "B").Value = theNum
GoTo here
End If
Next j
here:
theNum = ""
Next i
End Sub