+ Reply to Thread
Results 1 to 4 of 4

Using a String in Evaluate function

  1. #1
    Registered User
    Join Date
    02-09-2013
    Location
    Alberta, CA
    MS-Off Ver
    O365
    Posts
    80

    Using a String in Evaluate function

    Hi guys,

    I'm trying to use this in conjunction with finding the local IP of a machine from source-code.biz which is the first part of the code below

    Basically the IP is stored into 'IpAddrs' and I would like to use that in the Evaluate function further down.


    First part
    Please Login or Register  to view this content.

    Now testing the concept of what I'm trying to do it works. I use the 'blues' string in place of 'IpAddrs' and I get 3 in A1 and the local IP in A2
    Please Login or Register  to view this content.


    Now if I try to use that in the below I get a run time error 13 - type mismatch. A1 was a placeholder while I worked out chopping up the IP. Basically it looks at the first block of the IP (before the first . ) and the second block is between the first and second . of the IP. I am trying to replace the $A$1 section of the evaluate with the IpAddrs string.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Using a String in Evaluate function

    IP strings are not typically declared as INTEGER, they are typically declared as STRING.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-09-2013
    Location
    Alberta, CA
    MS-Off Ver
    O365
    Posts
    80

    Re: Using a String in Evaluate function

    Quote Originally Posted by JBeaucaire View Post
    IP strings are not typically declared as INTEGER, they are typically declared as STRING.
    In my clumsy troubleshooting I did try replacing all of the integers with String but it resulted in the same mismatch error

  4. #4
    Registered User
    Join Date
    02-09-2013
    Location
    Alberta, CA
    MS-Off Ver
    O365
    Posts
    80

    Re: Using a String in Evaluate function

    Further to it. I believe it has something to do with the IpAddrs string

    For example if I put the value of IpAddrs into range F1 and then say TestV is equal to the value of F1... it works fine


    Please Login or Register  to view this content.

+ 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. Type 13 Runtime Error Using String Variable in Evaluate Function
    By VBADoesMyWork in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-12-2014, 02:24 AM
  2. VBA - Evaluate Conditions as String
    By Tejas.T in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2013, 07:25 PM
  3. Evaluate String using function
    By graspindia in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-24-2008, 01:58 AM
  4. Evaluate text string as a function
    By benb in forum Excel General
    Replies: 3
    Last Post: 07-19-2006, 09:45 AM
  5. Replies: 11
    Last Post: 03-21-2006, 04:00 AM
  6. How to evaluate string?
    By Boban in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2005, 02:21 PM
  7. Evaluate string as a formula
    By peacelittleone in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-06-2005, 12:05 PM
  8. [SOLVED] Evaluate and execute a string
    By Randall in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2005, 01:05 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