• Read-Write Table Cells (2000,xp)

    Author
    Topic
    #395858

    Hello all,

    I’m trying to find a vba way to read and write cells in a table. The reading part works ok, I take the cell.range.text, and then pull all characters from the end less than ascii 32 (this may be overkill, as I’ve only seen ascii 7 and 13, but it works.

    The problem is in the writing. If I set a cell’s .range.text property to a certain value, say a date (10/30/2003 for example), it only works properly if the cell was empty. Otherwise, I get my value plus the last digit of what was in the cell before. Even if I set the value to “”, I end up with the value “3” (plus the ascii 13 & 7 of course), assuming the prior cell text ended with “3”.

    HansV, I checked your solution to post 289915, but all it did was what I’m doing, set the cell’s .range.text property.

    Isn’t there another way to do it?

    TIA

    Viewing 1 reply thread
    Author
    Replies
    • #737721

      Oops, looks like I answered my own question. Before setting the text, if you execute a Table(x).Cell(row,col).Range.Delete,
      that will clear the cell, then you can set the .Range.Text property. Still have to manually pull the ending Ascii 13 & 7 from the .Range.Text when you are READING the cell.

      Thanks anyway,

    • #737722

      Oops, looks like I answered my own question. Before setting the text, if you execute a Table(x).Cell(row,col).Range.Delete,
      that will clear the cell, then you can set the .Range.Text property. Still have to manually pull the ending Ascii 13 & 7 from the .Range.Text when you are READING the cell.

      Thanks anyway,

    Viewing 1 reply thread
    Reply To: Read-Write Table Cells (2000,xp)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: