+ Reply to Thread
Results 1 to 1 of 1

A cell, containing time, is shown as a numeric value

  1. #1
    Registered User
    Join Date
    05-16-2005
    Posts
    9

    Question A cell, containing time, is shown as a numeric value

    Hi,

    One of the columns in the table I use for a chart building is in time format (I even see it when is standing with coursor on a cell from the column: it looks like 20:20:06 in the cell and 8:20:06 PM in the formula bar).

    The problem begins when I try to use these cells for data validation, i.e. to check that it is data that look like 20:20:06 and not like 20:20.06 or 30:06. From some reason in my macros I see in debug mode that the value of these cells turns to be a numeric value like 0.18765.

    Why does it happen? How to "outflang" this problem?

    Here is the code I tried to use for validation:

    If InStr(Cells(RowNum, 1), ":") = 0 Or Len(Cells(RowNum, 1)) < 5_
    Or InStrRev(Cells(RowNum, 1), ":") <> Len(Cells(RowNum, 1)) - 2 Then
    Rows(RowNum).Delete Shift:=xlUp 'Delete the rows in which the first column is not in time format
    End If


    Please, help me
    Many thanks
    Last edited by lshilin; 05-16-2005 at 06:59 AM. Reason: code was incorrect

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1