Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    233

    Unanswered: create array from range of cells

    My code currently has this line:

    Sheets(Array("BA", "CA", "Co", "To", "Ex", "GW","AL")).Select

    if the name of a sheet changes it breaks my code.

    I dont want to select all the sheets, so i added a method that writes only the current name of sheets i want to select to a range on a spread sheet, so
    A1="BA"
    A2="CA"
    etc...

    how do i read those values to an array given that i selected the range of values already (range("TheNames").select ) ?

  2. #2
    Join Date
    Feb 2009
    Posts
    24
    mike,

    i don't fully understand your problem. see if this solves it...

    if you want to use the data in cells as array (i.e) data in the cell "A1",

    the code line is...
    Sheets("sheet1").range("A1").value

    now, since you have already selected the range, try using
    (range("TheNames").value) instead of (range("TheNames").select).
    Ganesh
    Everyone is gifted! Some open the package sooner!

Posting Permissions

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