Data types Cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, How can I ask for the data types of the cells, the VBA code need to
recognize between date, numbers and string data and me in what cell is
located, basically I just need to know how to ask for this different data
types.

Thanks
 
Hi, How can I ask for the data types of the cells, the VBA code need to
recognize between date, numbers and string data and me in what cell is
located, basically I just need to know how to ask for this different data
types.

Perhaps this way...

StringNameOfDataType = TypeName(Range("A1").Value)

or this way...

NumericCodeForDataType = VarType(Range("A1").Value)

depending on your needs.

Rick
 
Thanks that is what I was looking for

Rick Rothstein (MVP - VB) said:
Perhaps this way...

StringNameOfDataType = TypeName(Range("A1").Value)

or this way...

NumericCodeForDataType = VarType(Range("A1").Value)

depending on your needs.

Rick
 

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

Back
Top