Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    array value in string (2000)

    in VBA code please...
    I want to loop value in column F (start from F2) don until last cell is blank and fill a variable My_Var (demensioned as string) in this mode:

    AAAA1;BBBB2;CCCC3;...;ZZZZ1

    Column F
    AAAA1
    BBBB2
    CCCC3
    ....
    ZZZZ1

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: array value in string (2000)

    <code>Dim r As Long
    Dim m As Long
    Dim My_Var As String

    My_Var = ""
    ' Column F is column number 6
    ' Find last cell
    m = Cells(Rows.Count, 6).End(xlUp).Row
    ' Loop through the rows
    For r = 2 To m
    ' Concatenate My_Var with ; and the cell value
    My_Var = My_Var & ";" & Cells(r, 6)
    Next r
    ' Remove the first ;
    If Not My_Var = "" Then
    My_Var = Mid(My_Var, 2)
    End If</code>

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: array value in string (2000)

    no dubt!
    work fine.
    Tks.

Posting Permissions

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