+ Reply to Thread
Results 1 to 5 of 5

Error 2029 - Simply Want Strings

  1. #1
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    131

    Error 2029 - Simply Want Strings

    I have a text file that I want to process. I put the data into 3 columns and pull it into a worksheet with VBA. I'm coming across a field that happens to start with a dash. It's being interpreted as a formula (I guess) and is giving me type mismatches when I try to test it in any manner. I put the column data into an array and my code looks like this:

    Please Login or Register  to view this content.
    Worksheet_Array(Row, 2) had "- The Shed Fund" but the spreadsheet shows =- The Shed Fund.

    It looks like Excel is thinking it's a formula. How do I get it to work with simple strings, not evaluating anything in my sheet as any kind of a formula, and eliminate these errors?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Error 2029 - Simply Want Strings

    Try this...

    CStr(Worksheet_Array(Row, 2))
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

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

    Re: Error 2029 - Simply Want Strings

    Hello js0873,

    The information you have presented is incomplete. You don't say how you import the data or present any code to do the importing. The code you did post does not follow with the title of your post.

    The quickest way to resolve your problem is to post the workbook and a copy of the text file to be imported.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Quote Originally Posted by js0873 View Post
    It's being interpreted as a formula
    Obviously as per Excel rules you must format the destination cells as Text before to fill them
    or just add a single quote at the beginning of the string …

  5. #5
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    131

    Re: Error 2029 - Simply Want Strings

    Quote Originally Posted by AlphaFrog View Post
    Try this...

    CStr(Worksheet_Array(Row, 2))
    I think that does the trick. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. vlookup in VB returns 2029 error
    By C0ppert0p in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2013, 06:02 PM
  2. [SOLVED] Using Evaluate / Sumproduct Combination - Error 2029/15
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-08-2013, 07:03 PM
  3. [SOLVED] error 2029 with match named range
    By darahsten in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2013, 06:25 PM
  4. Error 2029 in LinEst
    By mst3k4L in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-10-2011, 06:23 PM
  5. macro interrupted error 2029
    By radame in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-26-2011, 02:59 PM
  6. Error 2029 - Trying to run an 07' file on 03'
    By PY_ in forum Excel General
    Replies: 2
    Last Post: 12-19-2010, 01:20 AM
  7. VBA Error 2029
    By John Eakins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-19-2007, 03:48 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