Results 1 to 9 of 9

Thread: [RESOLVED] Excel - Identifying "valid" characters in two specific columns

Threaded View

  1. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Excel - Identifying "valid" characters in two specific columns

    when you set testVal1 you used .Value, but when you set testVal2 you used .Text - was that a typo? Will it make a difference?
    .value is the content of the cell, .text is the displayed content, which includes cell formatting


    another method to test if the cell content is numeric
    Code:
    if val(cell.value = cell.value then
    this will only work with whole numbers or decimal character of .

    All of my data will be four digits (times) with the possibility of an apostrophe in front of any times that start with a zero(s) in order to keep the full four digits (ie., '0030, '0615, 1230, etc.)
    values preceded with ' are considered, by excel, to be strings, rather than numeric, so those with ' will by default justify to left of the cell, whereas numeric values will justify to right, though value will consider them to be the same, but not =
    Last edited by westconn1; Aug 18th, 2012 at 04:25 AM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width