+ Reply to Thread
Results 1 to 2 of 2

Can an excel column be passed into a VB array in Excel

  1. #1
    Registered User
    Join Date
    01-19-2005
    Posts
    1

    Can an excel column be passed into a VB array in Excel

    Hi,

    Can an excel column be passed into a VB array in Excel and vice-versa? If so, I appreciate if some one could help me in this regard.

    Thanks & Regards,
    Krishna

  2. #2
    Registered User
    Join Date
    12-07-2003
    Location
    scottsdale Az
    Posts
    1

    Lightbulb

    Dim myArray()

    Function StoreColumnInArray (byVal SourceColumn as String)

    Dim counter as Long
    counter = Cells(Cells.Rows.Count,SourceColumn).End(xlUp).Row


    ReDim myArray(1 to counter)
    For i = 1 to counter
    myArray(i)=Range( SourceColumn & i ).value
    Next i

    End Function

    Function DumpArrayToColumn(byVal TargetColumn as Integer)
    Dim i as Long

    For i = 1 to Ubound(myarray)
    Cells(TargetColumn,1).value = myarray(i)
    Next i

    End Sub
    Saru mo ki kara ochiru

    Ben Crisp

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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