+ Reply to Thread
Results 1 to 6 of 6

Can somebody confirm this?

  1. #1
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Can somebody confirm this?

    Hi All,

    I have some code which again activates alarms/warnings. It works fine although I don't think its good practice due to my misunderstanding of when to use ""




    Please Login or Register  to view this content.

    For example, should this line:

    Please Login or Register  to view this content.
    read as:

    Please Login or Register  to view this content.
    Any help would be much appreciated as I've potentially hundreds of these to do and do not want to start off on the wrong foot.
    Last edited by bralew; 11-01-2016 at 11:00 AM.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Can somebody confirm this?

    If its text then it should have speech marks so yes "GECKO" is the correct use

    If a control, variable etc can contain anything other than numbers then generally it should be encased in speech marks ("" or ')
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Can somebody confirm this?

    You ought also to be aware by now that Val converts numeric text to a true number value. Therefore Val() will never equal "Gecko".
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can somebody confirm this?

    That's what I thought xlnitwit?

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Can somebody confirm this?

    They are two separate issues.
    Unless GECKO is the name of a variable, it should always appear as "GECKO" in your code.
    Val is useful for coercing a userform control that contains a numeric string into a true number value. If you type 123 into a control on a form, its Value or Text properties will return "123" as a String. Val will convert that into the actual number 123.

  6. #6
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can somebody confirm this?

    I've now removed Val. I was confused between the use of Value and Vale. Thanks all

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. msgbox to confirm changes
    By Baziwan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2010, 07:46 AM
  2. Confirm cell edit
    By freud1 in forum Excel General
    Replies: 6
    Last Post: 06-07-2010, 05:23 AM
  3. Confirm function
    By rbpd5015 in forum Excel General
    Replies: 3
    Last Post: 04-11-2010, 11:03 AM
  4. Confirm on Exit
    By Jaymond Flurrie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2009, 05:22 PM
  5. What does confirm do?
    By Tnesper in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-15-2008, 05:33 PM
  6. [SOLVED] Macro confirm to run
    By Neil R in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2005, 03:55 PM
  7. Skipping confirm
    By Greg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2005, 09:06 AM
  8. [SOLVED] Confirm Autofilter off
    By Chris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2005, 04:06 PM

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