Solved

VB.net Excel Add-in Find which data type an Excel cell is

Posted on 2013-12-16
4
590 Views
Last Modified: 2013-12-19
Hi

I need to automatically detect which data type shown on the numbers form of the Format
Excel interface is. What VB.net code do I use to do this?

1
0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39721244
You mean you want to find out what format has currently been applied to the cell?
0
 

Author Comment

by:murbro
ID: 39721264
Yes, thanks.

So far I am using the following function

   Public Function GetNumberFormat(MyCell As Range) As String
        GetNumberFormat = MyCell.NumberFormat
    End Function

So for instance a Number with one decimal place is 0.0 and then with a number separater #,###0,0. See I am really just looking for a list of what each type of cell variation will return
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 39723427
It's not really clear to me what you expect the function to actually return? (Noting of course that the cell format is not in any way a reliable indicator of the data type of its contents!)
0
 

Author Closing Comment

by:murbro
ID: 39731142
You are right. It is unreliable
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question