Results 1 to 18 of 18

Thread: Solved: An error with setting a wb. Why?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #18
    VBAX Expert
    Joined
    Aug 2007
    Location
    Windermere, FL, a 'burb in the greater Orlando metro area.
    Posts
    567
    Location
    Malcolm,

    I have a new puzzle and it seems to involve the following function, in particular, the 3 range assignment. In a number of cases the result of the assignment is the new cell contains "#VALUE" instead of the text.

    [vba]Private Function Move_Data(std As String) As Boolean

    snip------
    With wsDiag
    .Range("B" & MyDiagRow) = wsInfo.Range("B" & MyInfoRow) ' LO#
    .Range("C" & MyDiagRow) = wsInfo.Range("E" & MyInfoRow) ' Short LO Code
    .Range("I" & MyDiagRow) = wsInfo.Range("F" & MyInfoRow) ' Question Stem
    .Range("G" & MyDiagRow) = wsInfo.Range("C" & MyInfoRow) ' Question #
    End With
    End Function [/vba]

    At first, I thought the problem was that there was more text in the source cell than Excel can write to the target cell. But, then, I noticed that the program had no trouble moving the largest text block (934 char) that I saw in a quick visual scan of the source worksheet. So, I'm flummoxed. And, a further so, look for a zip file in your mail box with all three files, the program, source and target w/ some data include these hiccups.

    I'd appreciate another pair of eyes looking at it.

    Edited in at 2300 EST: Strange, I'm unable to replicate this behavior on XL2007 on my PC laptop; both the user and I observed the behavior on the Mac OS X machines at the office, his MacBook Pro and my Mac Pro, each running XL2004. I suspect i better consult with mikerickson and see what he might suggest. I'll send you a copy of the files anyway.

    Thanks,
    Last edited by RonMcK; 06-03-2011 at 08:04 PM.
    Ron
    Windermere, FL

Posting Permissions

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