+ Reply to Thread
Results 1 to 1 of 1

Select value from textbox with concatenate

Hybrid View

  1. #1
    Registered User
    Join Date
    02-01-2022
    Location
    Czech
    MS-Off Ver
    2010
    Posts
    10

    Question Select value from textbox with concatenate

    Hello Guys a i have a problem.
    i am making an Form what will load data from PLC Siemens, but i stuck on the picking value.

    I need pick or connect to the value from concatenate what will read my written value in textbox. Sending code

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Function concatenate()
        
        Dim jedna As String
        Dim dva As String
        Dim Pracoviste As String
        Dim tri As String
        Dim ctyri As String
        Dim pet As String
        Dim sest As String
        Dim sedm As String
        Dim Celek As String
        Dim Dot As String
        Dim Uv As String
        
        
        jedna = "ns=3;s="
        dva = "STATION_"
        Pracoviste = nastaveniForm.pracovistebox.Value
        ctyri = "_DB"
        pet = "data_IN_OUT"
        sest = "data_OUT"
        sedm = "data"
        Dot = "."
        Uv = """"
        'ns=3;s="STATION_18_DB"."data_IN_OUT"."data_OUT"."data"
        Celek = jedna & Uv & dva & Pracoviste & tri & ctyri & Uv & Dot & Uv & pet & Uv & Dot & Uv & sest & Uv & Dot & Uv & sedm & Uv
        nastaveniForm.pracovistebox.AddItem Celek.Value
        pracovistebox.Text = ""
        
        
    End Function
    
    Sub hodnoty_Click()
    
      
        
        Dim strNodeIdMethod As String
        
        strNodeIdMethod = nastaveniForm.pracovistebox
        
        
        Dim strValues() As String
        
        
        'get arguments
        On Error Resume Next
        strValues = Sheets("Mereni").m_OpcUaClient.ReadStructUdt(strNodeIdMethod)
            
        'error handling for ReadValues
        If Err.Number <> 0 Then
            MsgBox Err.Description
            Exit Sub
        End If
        
        'Get array upper bound for call method function
        Dim i, iUbound, iLbound, iRow As Integer
        
        'print first string
        iRow = 11
        iUbound = (UBound(strValues) + 1) / 3 - 1
        iLbound = LBound(strValues)
        
        For i = iLbound To iUbound
            Range("A" + Trim(str(iRow))).Value = strValues(i)
            iRow = iRow + 1
        Next
        
        'print second string
        iRow = 11
        iUbound = ((UBound(strValues) + 1) / 3) * 2 - 1
        iLbound = (UBound(strValues) + 1) / 3
        
        For i = iLbound To iUbound
            Range("B" + Trim(str(iRow))).Value = strValues(i)
            iRow = iRow + 1
        Next
        
        'print third string
        iRow = 11
        iUbound = UBound(strValues)
        iLbound = ((UBound(strValues) + 1) / 3) * 2
        
        For i = iLbound To iUbound
            Range("C" + Trim(str(iRow))).Value = strValues(i)
            iRow = iRow + 1
        Next
        
    End Sub
    Last edited by 6StringJazzer; 02-01-2022 at 08:51 AM.

+ 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. select mutliple fields and then concatenate them
    By Gius in forum Excel General
    Replies: 1
    Last Post: 12-04-2018, 08:47 PM
  2. [SOLVED] How to select all text in textbox when i click textbox "userform"
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2017, 11:30 AM
  3. How to concatenate two or more textboxes in one textbox
    By beto77 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2016, 05:17 PM
  4. Concatenate textbox and label values inside UF
    By Grilleman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2015, 04:53 PM
  5. Multi-Worksheet ActiveX Textbox to ActiveX Textbox Concatenate
    By HVE_Skynet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-21-2014, 02:11 PM
  6. [SOLVED] concatenate two combobox into one textbox in userform
    By hamidrezaxy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2013, 03:57 AM
  7. concatenate listbox results in textbox
    By rickdaw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2012, 05:46 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