+ Reply to Thread
Results 1 to 3 of 3

Double Value in text to be displayed as 410.0 rather than 410

  1. #1
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Double Value in text to be displayed as 410.0 rather than 410

    Hi,

    I am running into an issue and I need help from VBA Experts here..

    Below is part of a text string which I am trying to dynamically generate.

    The Value 55 will come from somewhere, say Cell A1

    "ValueOfDelta":55.0

    If I type the below in the Immediate Window

    ?"""" & "ValueOfDelta" & """" &":" & [A1]

    I get answer as "ValueOfDelta":55 (notice the .0 being omitted). I want the String to be displated as "ValueOfDelta":55.0 (With .0 trailing)

    I cannot have it as text, for example "ValueOfDelta":"55.0"

    I am communicating a DLL which needs a Double. If I omit .0, then it stops working.

    Any help please?
    Cheers!
    Deep Dave

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Double Value in text to be displayed as 410.0 rather than 410

    Hi,

    I was able to solve the issue like this 0

    application.WorksheetFunction.Substitute(CheckValueType(Format(CDbl(1#), "###0.0")),"""","")

    CheckValueType was a UDF

    Thanks for the help

  3. #3
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Double Value in text to be displayed as 410.0 rather than 410

    Possibly...
    Please Login or Register  to view this content.
    which returns
    Please Login or Register  to view this content.
    in the immediate window?

+ 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. Text displayed in next cell
    By lba1109 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-25-2014, 12:24 PM
  2. [SOLVED] Set number value displayed in cell when certain text value is displayed in another
    By chrisswann in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-18-2013, 09:07 AM
  3. [SOLVED] Text not fully displayed when text direction changed
    By Mikey9131 in forum Excel General
    Replies: 3
    Last Post: 11-30-2005, 08:15 AM
  4. [SOLVED] How do I limit what text is displayed?
    By Erik Millerd in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. [SOLVED] How do I limit what text is displayed?
    By ScottO in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 06:05 AM
  6. How do I limit what text is displayed?
    By Erik Millerd in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. [SOLVED] Text in autoshape not displayed
    By Gaurav in forum Excel General
    Replies: 2
    Last Post: 04-01-2005, 01:06 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