+ Reply to Thread
Results 1 to 5 of 5

writing values to range - first entry repeated

Hybrid View

  1. #1
    Registered User
    Join Date
    07-25-2008
    Location
    Tucson, AZ
    Posts
    90

    writing values to range - first entry repeated

    I'm having trouble with this set of commands

     'define range to print output column
                    Set output_column_range = Sheets(output_response_sheet).Range("rng_DependentData").Columns(x).Cells
                    'write data column to range
                    output_column_range.Value = output_matrix_column
    the range and the array are the same length, 25 elements. However it only writes the first entry to the range, repeating it 25 times, rather than printing all the unique entries. What's wrong with my syntax?
    Attached Files Attached Files
    Last edited by twd000; 01-02-2009 at 10:04 AM. Reason: solved

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello twd000,

    I have checked the code range assignments and syntax. There doesn't appear to be problems with this code segment. You do have a lot going on in this workbook. It would help to know exactly what error you are receiving.

    Sincrely,
    Leith Ross

  3. #3
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi

    Looks like you have a 1 dimensional array being written to the range so try this:

    output_column_range.Value = Application.Transpose(output_matrix_column)
    Richard
    Richard Schollar
    Microsoft MVP - Excel

  4. #4
    Registered User
    Join Date
    07-25-2008
    Location
    Tucson, AZ
    Posts
    90
    thanks Richard

    transposing the matrix worked perfectly


  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ 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