Closed Thread
Results 1 to 2 of 2

Highlight negative numbers in PPT (Text box)

  1. #1
    Registered User
    Join Date
    12-27-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Highlight negative numbers in PPT (Text box)

    Hi Everyone,
    I have written a code where it highlights the text (Negative numbers) as per the Input Box. But my code is highlighting the whole text box but i need to highlight only 1 line irrespective of length of 1 line.
    For Example :
    Line1: -100$ product
    Line2: +200$ product
    Line3: +300$ product
    Line4: -200$ product
    In this case i need to highlight the Line 1&4. Can anyone please help me in solving that? Below is the code.

    #Sub redcolor1()
    Dim SlideNo As Slide, AllShape As Shape, RowCnt As Integer, ColCnt As Integer
    Dim nega As String
    nega = InputBox("Input the sign of negative no's to be formatted [- or (]")
    For Each SlideNo In ActivePresentation.Slides
    For Each AllShape In SlideNo.Shapes
    If AllShape.Type = msoTextBox Then
    'For RowCnt = 1 To AllShape.Table.Rows.Count
    'For ColCnt = 1 To AllShape.Table.Columns.Count
    'AllShape.Table.Cell(RowCnt, ColCnt).Shape.TextFrame.TextRange.Font.Name = "Corbel"
    'AllShape.Table.Cell(RowCnt, ColCnt).Shape.TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter
    'AllShape.Table.Cell(RowCnt, ColCnt).Shape.TextFrame.VerticalAnchor = msoAnchorMiddle
    If Left(AllShape.TextFrame.TextRange, 1) = nega Then
    AllShape.TextFrame.TextRange.Font.Color.RGB = RGB(255, 0, 0)
    End If
    'Next ColCnt
    'Next RowCnt
    End If
    Next AllShape
    Next SlideNo
    End Sub#

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    18,478

    Re: Highlight negative numbers in PPT (Text box)

    Welcome to the Forum, unfortunately this is a duplicate post and as such will now be closed, you may continue in your other thread.

    Thread Closed.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Highlight negative numbers in PPT (Text box)
    By hvsuhas in forum PowerPoint Formatting & General
    Replies: 1
    Last Post: 03-21-2018, 08:30 AM
  2. [SOLVED] Search cell that contains multiple numbers and text and pull out only the negative number
    By frenchrich504 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-05-2016, 03:38 PM
  3. Replies: 2
    Last Post: 08-04-2014, 08:57 AM
  4. [SOLVED] How to change numbers to negative numbers specific with a text
    By Patnaik in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-11-2012, 07:22 AM
  5. importing a text file with negative numbers into excel?
    By jstnvndn in forum Excel General
    Replies: 1
    Last Post: 09-19-2006, 09:45 AM
  6. converting text to negative numbers!
    By via135 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-05-2006, 02:29 AM
  7. Text Columns Negative Numbers Upgrade Excel?
    By Dust Bun in forum Excel General
    Replies: 1
    Last Post: 07-22-2005, 02:05 PM

Tags for this Thread

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