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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to work with errors in visual basic

How to work with errors in visual basic

Scheduled Pinned Locked Moved Visual Basic
helptoolstutorial
2 Posts 2 Posters 0 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.
  • M Offline
    M Offline
    Matthew Leggett
    wrote on last edited by
    #1

    Hi Folks I am Using Visual Basic within Excel and have encountered a problem I hope someone can help with I have a table of Bills and months ie Month1 Month2 ........ Bill 1 0 0 Bill 2 0 0 Bill 3 0 0 For each bill there is a value in the month column. Each Cell starts with a value of 0 I create a NEW worksheet ie - NEWSHEET and this passes a formula back to cell C3 on sheet Bills C3 before = 0 C3 after = NEWSHEET!L5 - showing the contents of Cell L5 ON Sheet NEWSHEET When I delete the NEWSHEET for whatever reason the value of C3 changes to this:- C3 becomes =#REF!L5 In itself this isn't a problem as I was expecting this to happen however once the cell contains =#REF!L5 I want to run a small script to look at each cell and if the value of the cell is =#REF!L5 then I want to reset the value to zero if the value of the cell isn't =#REF!L5 then I wish to leave the value alone Hope this makes sense and that someone can assist

    C 1 Reply Last reply
    0
    • M Matthew Leggett

      Hi Folks I am Using Visual Basic within Excel and have encountered a problem I hope someone can help with I have a table of Bills and months ie Month1 Month2 ........ Bill 1 0 0 Bill 2 0 0 Bill 3 0 0 For each bill there is a value in the month column. Each Cell starts with a value of 0 I create a NEW worksheet ie - NEWSHEET and this passes a formula back to cell C3 on sheet Bills C3 before = 0 C3 after = NEWSHEET!L5 - showing the contents of Cell L5 ON Sheet NEWSHEET When I delete the NEWSHEET for whatever reason the value of C3 changes to this:- C3 becomes =#REF!L5 In itself this isn't a problem as I was expecting this to happen however once the cell contains =#REF!L5 I want to run a small script to look at each cell and if the value of the cell is =#REF!L5 then I want to reset the value to zero if the value of the cell isn't =#REF!L5 then I wish to leave the value alone Hope this makes sense and that someone can assist

      C Offline
      C Offline
      ChandraRam
      wrote on last edited by
      #2

      Look up functions IsNA, IsError... you can use those to check the cell values and modify contents if needed. HTH

      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