+ Reply to Thread
Results 1 to 5 of 5

Pass displayed text from one cell to the underlying value of another cell?

  1. #1
    Registered User
    Join Date
    01-02-2007
    Posts
    3

    Pass displayed text from one cell to the underlying value of another cell?

    Hello-

    I am trying to get Excel 2000 to put the displayed text from one cell into the cell "value" of another cell. I have a LISP program in AutoCAD that looks up and changes text. If I create a text entity in a drawing and give it the names of a cell ("A1"), the LISP routine searches a specified worksheet for cell A1 and changes the text entity to the cell value. I want to use this to create labels for stuff in my drawing.

    I made a custom format for the cells in Excel to display "30 ft." when the cell value is 30.00. When I run my LISP program, it returns the un-formated cell value to my label. I get "30.00000" instead of "30 ft."

    Can I somehow make a new range of cells who's underlying value is the same as the formated displayed text in another range of cells?

    -Patrick

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by fordskydog
    Hello-

    I am trying to get Excel 2000 to put the displayed text from one cell into the cell "value" of another cell. I have a LISP program in AutoCAD that looks up and changes text. If I create a text entity in a drawing and give it the names of a cell ("A1"), the LISP routine searches a specified worksheet for cell A1 and changes the text entity to the cell value. I want to use this to create labels for stuff in my drawing.

    I made a custom format for the cells in Excel to display "30 ft." when the cell value is 30.00. When I run my LISP program, it returns the un-formated cell value to my label. I get "30.00000" instead of "30 ft."

    Can I somehow make a new range of cells who's underlying value is the same as the formated displayed text in another range of cells?

    -Patrick
    I don't think your question is understood.

    A number is held as the Value of a cell, how the cell displays that number is a cell attribute, and not related to the number, thus 30.000000 is the value, and '## ft' the cell attribute.

    This attribute can be shown by Record a Macro, and Set a cell to the required display, then Stop and Edit the macro to see something like
    Selection.NumberFormat = "## Ft"

    Does this help you?
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    01-02-2007
    Posts
    3
    I don't really understand the reply.

    I somehow need to get the value of cells to read how I want the labels to appear in my drawings. Currently, I have a worksheet in my field logging workbook that summarizes information from other worksheets. My intention is to point my AutoCAD LISP routine to this summarized worksheet and have it create my labels for me. Even though I formated the cells to display "30 ft." or "10.2 CY" or whatever, the value of the cells are "30.0000000" and "10.2000000" respectively. My LISP routine (not written by me) returns only the value of the cell and disregards any formating, so my labels come out as "30.0000000" and "10.2000000" and don't mean anything to the person looking at the drawing.

    My question is whether or not there is a way in Excel to make a cell have the value "30 ft." rather than have a value of "30.0000000" and a format of "## ft.". If I can do this without any programing languages, or with a simple macro, it will be much easier in the short term, as I am not familiar with VBA or VB.NET or C# or anything much heftier than HTML.

    I see that I am running into a brick wall here in not knowing VB. Ultimately, I'd like to integrate Excel, Word, Access, AutoCAD, and MapWindow GIS to streamline the routine creation of presentaion materials and also to analyze and organize complex data for engineering analysis. I know what I want to do, but I don't know how to do it, and finding the starting point is the hardest part.

    I have SharpDevelop and all the programs above. If anyone can solve my simple problem above, or point me to some good resources for VB.NET newbies it would be GREATLY appreciated!

    Thanks in advance,
    Patrick

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,949
    Instead of using number formats, use text functions. Something like =concatenate(text(formula,"0.0")," ft")

  5. #5
    Registered User
    Join Date
    01-02-2007
    Posts
    3
    Thankyouthankyouthanyou

+ 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