dcsimg
Results 1 to 4 of 4
  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    3

    Excel Conditional Formatting in VS2013

    Hello,

    I'm fighting with the following simple line of code:

    Code:
    oFormatCondition1 = CType(xlRange.FormatConditions.Add(Type:=Excel.XlFormatConditionType.xlCellValue, Operator:=Excel.XlFormatConditionOperator.xlNotEqual, Formula1:="=RC[-1]"), Excel.FormatCondition)
    if I just replace "=RC[-1]" by a numeric value, it's working, but not with this formula!

    the condition I want to write is: if this cell value <> the previous cell value (RC[-1])

    Can someone help me here ?
    Thanks in advance

  2. #2

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    3

    Re: Excel Conditional Formatting in VS2013

    Hey, hey,
    nobody to help me ?
    thanks in advance

  3. #3
    Frenzied Member ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    1,063

    Re: Excel Conditional Formatting in VS2013

    Hi,

    perhaps this will help...

    Code:
    ......
      'Calulate values, 
            'in German = "=Summe(D2:D5)"
            'in Englisch probably = "=Sum(D2:D5)"
            oSheet.Range("D7").Value = "=Summe(D2:D5)"
            oSheet.Range("D7").NumberFormatLocal = "#.##0,00"
    .......
    regards
    Chris
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    3

    Re: Excel Conditional Formatting in VS2013

    Thanks a lot for your answer ChrisE.

    I found how to fix this issue, and it doesn't sound logical to me ! but it's working !

    I write formulas in my Excel file with RC type formula (eg. "=RC[-1]")
    And for conditional formatting, I need to write formulas in French (installation langage). So for me, it's LC(-1).
    It doesn' really make sense to me to write formulas in both formats ...

    Anyway, if someone gets this problems too, you may want to try this solution.
    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.