+ Reply to Thread
Results 1 to 3 of 3

Autoformat decimal places depending on value?

  1. #1
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    197

    Autoformat decimal places depending on value?

    Can you use autoformat to change the number of decimal places of a cell depending on the value of another cell?

    For example:

    Cell A1 is a number which needs to be to 3, 4 or 5 decimal places depending on the value of cell B1 as follows:

    B1 value Number of decimal places that A1 needs to be
    "T1" 3
    "T5" 4
    "T6" 5

    I would have done this as a macro on start of sheet, but the value of B1 can change at any time.

    Thanks for any help.
    Last edited by wonderdunder; 06-05-2011 at 10:04 AM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Autoformat decimal places depending on value?

    Difficult to say without a clear example.

    To set the decimal places of an integer, you can divide it by 10^nr_of_places

  3. #3
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    197

    Re: Autoformat decimal places depending on value?

    Well I've got round it - I've had to make some other adjustments to the spreadsheet but it still works - I just recorded a macro and then added an IF statement to incorporate it into VBA.

+ 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