Results 1 to 2 of 2

Highlight negative numbers in PPT (Text box)

Threaded View

hvsuhas Highlight negative numbers in... 03-21-2018, 05:49 AM
mainemojo Re: Highlight negative... 03-21-2018, 08:30 AM
  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
    #
    Last edited by alansidman; 03-21-2018 at 08:42 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 9
    Last Post: 04-20-2016, 02:42 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1