Consulting

Results 1 to 3 of 3

Thread: logic operator bug, I've never had anything like this

  1. #1

    logic operator bug, I've never had anything like this

    Hello everone,

    i want to Count Frequencies of the measured values in areas.

    When he should write in Row 55 für the Value 0.2,
    he over jump this if-case:

     If sheet.Cells(ReadRow, ZSwrite(1)) <= sheet.Cells(WriteRow, ZSwrite(1)) Then            
                holderForMyself = sheet.Cells(WriteRow, WriteReadColumn + 1)
                sheet.Cells(WriteRow, WriteReadColumn + 1) = CInt(sheet.Cells(ReadRow, WriteReadColumn + 1)) + holderForMyself
     End If
    While the left and Right side in the if-condition is the same, he over pass the if-case.

    Hope you know where the error comes from.

    Mappe1.xlsb

  2. #2
    VBAX Regular arangogs's Avatar
    Joined
    Jun 2009
    Location
    Ayrshire, Scotland
    Posts
    18
    Location
    Hi Markusf1895,

    Not totally sure what you are looking to do. I think you are expecting to write to row 55 as it matches row 21 of 0.2?

    I suspect the value in the cell is likely not matching on the decimal Nth point.

    you could use round\floor function to match the data
    round(sheet.Cells(ReadRow, ZSwrite(1)),4) <= round(sheet.Cells(WriteRow, ZSwrite(1)),4)

  3. #3
    Perfect, this is the solution.��

Posting Permissions

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