+ Reply to Thread
Results 1 to 7 of 7

Comparing a value of concantenation of strings against a string

  1. #1
    Registered User
    Join Date
    05-19-2017
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    4

    Comparing a value of concantenation of strings against a string

    I am trying to compare the value of the concantenation of the port_val variable without quotes so it reads similar: s_1_0_2.value . This so happens to be an objectname in the userform:

    Please Login or Register  to view this content.
    Any ideas?
    Last edited by seph2004; 05-19-2017 at 05:13 PM. Reason: Moderation request fulfillment

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Need a solution for this one

    How do you expect that port_val could be Business, Process or Acess point, when you assagn value like this: "s" & stack & "_0_" & interface & ".value"
    I assume stack and interface are global variables with broader scope than the current function
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Need a solution for this one

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    05-19-2017
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    4

    Re: Need a solution for this one

    Quote Originally Posted by buran View Post
    How do you expect that port_val could be Business, Process or Acess point, when you assagn value like this: "s" & stack & "_0_" & interface & ".value"
    I assume stack and interface are global variables with broader scope than the current function
    Correct buran

    The dilemma is trying to compare s_1_0_1.value (combobox value) against the 3 strings but I don't want to put a bazillion if then statements for each of the comboboxes.

  5. #5
    Registered User
    Join Date
    05-19-2017
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    4

    Re: Need a solution for this one

    Quote Originally Posted by buran View Post
    How do you expect that port_val could be Business, Process or Acess point, when you assagn value like this: "s" & stack & "_0_" & interface & ".value"
    I assume stack and interface are global variables with broader scope than the current function
    I think my best bet is to set the value of each combobox to another interface variable so I can then get rid of the For Loop and just set the value. I can put an If Then statement on each combobox to check whether it is blank and set a boolean variable and then the command button I use to execute and copy the variable data can look for that boolean in order to populate the data or not. I think I have a resolution for this issue and can close this.

    Let me know your thoughts.

  6. #6
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Comparing a value of concantenation of strings against a string

    I think this should do what you want
    Please Login or Register  to view this content.
    keep it in the loop so you don't need to repeat code
    Last edited by buran; 05-23-2017 at 04:51 AM.

  7. #7
    Registered User
    Join Date
    05-19-2017
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    4

    Re: Comparing a value of concantenation of strings against a string

    Quote Originally Posted by buran View Post
    I think this should do what you want
    Please Login or Register  to view this content.
    keep it in the loop so you don't need to repeat code
    Yes, I used this after some research. Works perfectly every time!

+ 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. Looking for a SUM UNTIL solution
    By pmguerra in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2017, 05:19 AM
  2. Looking for a sumproduct solution or any other possible solution
    By akliot in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 04-29-2015, 11:42 AM
  3. Is 'ranking by' a VBA solution or a manual solution?
    By mtw2018 in forum Excel General
    Replies: 2
    Last Post: 04-10-2012, 01:47 PM
  4. N/A to 0 Solution
    By CraigyBoy in forum Excel General
    Replies: 8
    Last Post: 02-10-2011, 04:06 AM
  5. NA Solution
    By bear in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-28-2007, 02:03 AM
  6. [SOLVED] Best solution VBA/C++
    By Charles in forum Excel General
    Replies: 3
    Last Post: 08-02-2006, 01:00 PM
  7. Vba Help With A Solution
    By RELWOD85 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2005, 02: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