Results 1 to 12 of 12

Textbox negative values not showing correctly

Threaded View

Ochimus Textbox negative values not... 05-03-2019, 10:37 AM
Fluff13 Re: Textbox negative values... 05-03-2019, 10:39 AM
shg Re: Textbox negative values... 05-03-2019, 10:44 AM
romperstomper Re: Textbox negative values... 05-03-2019, 10:47 AM
shg Re: Textbox negative values... 05-03-2019, 10:57 AM
Ochimus Re: Textbox negative values... 05-03-2019, 02:58 PM
Fluff13 Re: Textbox negative values... 05-03-2019, 03:07 PM
Ochimus Re: Textbox negative values... 05-03-2019, 03:18 PM
shg Re: Textbox negative values... 05-03-2019, 03:27 PM
Ochimus Re: Textbox negative values... 05-03-2019, 04:04 PM
Ochimus Re: Textbox negative values... 05-03-2019, 08:29 PM
romperstomper Re: Textbox negative values... 05-07-2019, 03:16 AM
  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,474

    Textbox negative values not showing correctly

    The ROI($) value is the SALE - INVESTMENT.
    The ROI(%) value is the (SALE-INVESTMENT)/SALES

    If the values are negative they are red and in brackets, but both still show the Minus sign, and the ROI (%) has a leading "Hashmark".

    Option Explicit
    Dim a As Long, f As Long
    Dim c As Range
    Dim ws As Worksheet
    
    Private Sub CommandButton2_Click()
    
        If tboxSPINV <> "" And tboxSPSALES <> "" Then
        
        tboxSPROICASH.Value = tboxSPSALES - tboxSPINV
            If tboxSPROICASH.Value < 0 Then
            tboxSPROICASH.Value = Format(tboxSPROICASH, "($#,##0.00)")
            tboxSPROICASH.ForeColor = RGB(255, 0, 0)
            
            Else: tboxSPROICASH.Value = Format(tboxSPROICASH, "$#,##0.00)")
            tboxSPROICASH.ForeColor = RGB(0, 0, 0)
            End If
            
        tboxSPROIPER.Value = (tboxSPSALES - tboxSPINV) / tboxSPSALES
            If tboxSPROIPER < 0 Then
            tboxSPROIPER.Value = Format(tboxSPROIPER.Value, "(\#,##0.00%)")
            tboxSPROIPER.ForeColor = RGB(255, 0, 0)
            
            Else: tboxSPROIPER.Value = Format(tboxSPROIPER.Value, "#,##0.00%")
            tboxSPROIPER.ForeColor = RGB(0, 0, 0)
            End If
            
        End If
       
    End Sub
    
    Private Sub CommandButton4_Click()
    
        Unload Me
    
    End Sub
    Any solutions, suggestions or alternatives received gratefully as ever

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 05-03-2019 at 10:40 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 12-19-2016, 05:34 PM
  2. showing Labels and Textbox values
    By zaku in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-17-2015, 12:30 PM
  3. [SOLVED] Negative or zero values cannot be plotted correctly on log charts
    By NTE in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 03-28-2012, 11:32 AM
  4. Replies: 2
    Last Post: 06-19-2011, 11:48 AM
  5. Excel 2007 : Values not showing correctly in chart
    By kuroneko4 in forum Excel General
    Replies: 1
    Last Post: 01-21-2010, 12:54 PM
  6. Replies: 1
    Last Post: 08-18-2009, 07:35 AM
  7. Showing Negative Values As 0
    By AlanWade in forum Excel General
    Replies: 6
    Last Post: 06-25-2008, 02:52 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