+ Reply to Thread
Results 1 to 5 of 5

using the split function on an array of strings

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Question using the split function on an array of strings

    Hello everyone.

    I have an array thats elements are populated with strings of the ranges in the format of
    Reference_Array(i,j,k) = "myWorkbook,ThisWorksheet,B3:B10"

    how do i split this array element, deliminated by the commas?

    Please Login or Register  to view this content.
    Thanks for your help
    Regards Jordan
    Last edited by jordan2322; 01-30-2013 at 11:43 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: treating an element from array as string

    Post the code for BuildReferenceArray. You imply that it builds an array with strings like: "Worksbooks(myWorkbook).Sheets(ThisWorksheet).Range("B3:B10")"
    But that would result in only a one dimensional list (vector). Where do three dimensions fit in?
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: treating an element from array as string

    Heres the code for the BuildReferenceArray. the array is 3 dimensional and holds various information from the worksheet in which its run.

    yes your right - the BuildReferenceArray fills its elements with strings like
    Workbooks(ThisWorkbook).Sheets(ThisSheet).Range(A1:A10)

    The other dimension holds more range strings like the one i've written above. and another dimension is used for the number of worksheets in the workbook.

    Please Login or Register  to view this content.
    Last edited by jordan2322; 01-30-2013 at 11:38 PM.

  4. #4
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: using the split function on an array of strings

    I've modified the title of this thread to better reflect what i'm after..
    I've also modified the BuildReferenceArray - where I'm adding strings to the array elements for B column through to the H column
    I'm now adding strings of the form MyWorkbook.xls,01-01-2013,A1:A10

    So now i have array elements of string type which i wish to split into the 3 individual components (deliminated by the comma) so that i can use them in functions such as
    workbook(MyWorkbook.xls).Sheets(01-01-2013).Range(A1:A10).Interior.ColorIndex = 3

    if someone could point me in the right direction with how to do this that would be much appreciated!

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: using the split function on an array of strings

    Hi Jordan2322
    maybe something like this
    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)

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