Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Excel VBA seems to read an old value from a cell

Excel VBA seems to read an old value from a cell

Scheduled Pinned Locked Moved Visual Basic
helpdebugginglounge
4 Posts 4 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    idkd
    wrote on last edited by
    #1

    I have a weird situation where (randomly) a previous Cell value is read by the Excel VBA code. eg: Cell 1A had a value = Y. It was updated to N. However a subsequent VBA code read the cell value as Y It has been hard to troubleshoot as this was a random occurrence. I was lucky to catch one today, and upon stepping through the code (using F8) discovered that the correct current value was read during debug!. Re-run the macro without debug mode and the correct value was read. Its very confusing and I cannot think of anything but an Excel bug. Have you encountered this issue at all and if so what solution/s have you applied. Thanks in advance.

    L M Z 3 Replies Last reply
    0
    • I idkd

      I have a weird situation where (randomly) a previous Cell value is read by the Excel VBA code. eg: Cell 1A had a value = Y. It was updated to N. However a subsequent VBA code read the cell value as Y It has been hard to troubleshoot as this was a random occurrence. I was lucky to catch one today, and upon stepping through the code (using F8) discovered that the correct current value was read during debug!. Re-run the macro without debug mode and the correct value was read. Its very confusing and I cannot think of anything but an Excel bug. Have you encountered this issue at all and if so what solution/s have you applied. Thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      With the amount of people that have been using Excel, it is very unlikely that there's a bug that's that basic. Also, the computer doesn't do stuff "randomly"; that's simply our way of describing stuff when we can't see the pattern. Is there timing involved in your code? Can you reproduce the error?

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

      1 Reply Last reply
      0
      • I idkd

        I have a weird situation where (randomly) a previous Cell value is read by the Excel VBA code. eg: Cell 1A had a value = Y. It was updated to N. However a subsequent VBA code read the cell value as Y It has been hard to troubleshoot as this was a random occurrence. I was lucky to catch one today, and upon stepping through the code (using F8) discovered that the correct current value was read during debug!. Re-run the macro without debug mode and the correct value was read. Its very confusing and I cannot think of anything but an Excel bug. Have you encountered this issue at all and if so what solution/s have you applied. Thanks in advance.

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        Male sure you are reading the same value IE CurrentValue, excel has the ability to roll back changes and you may be reading from the wrong/different property.

        Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

        1 Reply Last reply
        0
        • I idkd

          I have a weird situation where (randomly) a previous Cell value is read by the Excel VBA code. eg: Cell 1A had a value = Y. It was updated to N. However a subsequent VBA code read the cell value as Y It has been hard to troubleshoot as this was a random occurrence. I was lucky to catch one today, and upon stepping through the code (using F8) discovered that the correct current value was read during debug!. Re-run the macro without debug mode and the correct value was read. Its very confusing and I cannot think of anything but an Excel bug. Have you encountered this issue at all and if so what solution/s have you applied. Thanks in advance.

          Z Offline
          Z Offline
          ZurdoDev
          wrote on last edited by
          #4

          No, but you should probably post the relevant code.

          Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups