VB Function Needed - Differentiate between a number and a characte

I

Iffy Functionality

Hello,

Trying to setup a simple code to rearrange some data. The data looks like:

blah blah
123
33
222
123
44
22
blah blah

What I'm doing is moving all of the data into one line. The data is always
in groups of threes with text strings thrown into random rows in between the
groups of three. I have a VB script set to reorganize the data, however I
can't find a function or appropriate method to tell whether the cell that is
currently selected contains a number or character string. Can you offer any
help or ideas?

Thank you!
Iffy
 
G

Gary''s Student

Sub gsnu()
If Application.IsNumber(Selection.Value) Then
MsgBox ("number")
Else
MsgBox ("not number")
End If
End Sub


If you are testing a cell in the worksheet.
 
I

Iffy Functionality

That's perfect - thank you!

Gary''s Student said:
Sub gsnu()
If Application.IsNumber(Selection.Value) Then
MsgBox ("number")
Else
MsgBox ("not number")
End If
End Sub


If you are testing a cell in the worksheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top