Results 1 to 8 of 8

Transpose Array Result Empty

Threaded View

  1. #1
    Forum Contributor aprildu's Avatar
    Join Date
    04-13-2014
    Location
    Barrie,On, Canada
    MS-Off Ver
    Excel 2016
    Posts
    175

    Transpose Array Result Empty

    I have an array that is set to variant and then redim preserved. I can see it's clearly populated in the locals window however it's not showing on sheet when I transpose it:

    dim arComments() as variant
    
    n=sheet1.cells(rows.count,"a").end(xlup).row-1
    
    redim preserve arComments(1 to n)
    
    for i= 1 to n
        on error resume next
        id=sheet1.cells(i+1,"a")
        comments=application.worksheetfunction.vlookup(id,sheet2.range("tbldata"),2,0)
    
    if err.number<>0 then
      comments=sheet1.cells(i+1,"b")
    end if 
        arComments(i)=comments
    next i
    
    
    sheet3.range("b2:b" & n+1)=application.worksheetfunction.transpose (arComments)
    Similar code works for another two routines but this one is stubborn. I don't know why it comes up empty.
    Last edited by aprildu; 02-10-2018 at 02:08 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Transpose a table and fill empty cells with responses
    By Arno_NI in forum Excel General
    Replies: 2
    Last Post: 11-20-2017, 10:47 AM
  2. Show cell empty if result is an error due to empty source
    By jackmcguigan1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2016, 09:54 AM
  3. [SOLVED] Find duplicate in a cloumn and get result from other column as transpose
    By Sideshmukh in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-11-2016, 01:08 AM
  4. [SOLVED] Text to columns, transpose data & final result
    By sam1105 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-19-2015, 03:36 AM
  5. Macro to paste value transpose range adjacent to lookup result
    By SimpleSimon99 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-28-2014, 11:39 PM
  6. find each of the items in an array and save result in another array
    By lif in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2006, 08:54 PM
  7. Replies: 1
    Last Post: 08-01-2005, 08:05 PM

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