Solved

How to get Excel "Cell" instruction to work

Posted on 2014-02-27
6
177 Views
Last Modified: 2014-02-27
I'm trying to write an Excel VBA program that will use a worksheet to debug the steps of the code so that I can see where I am programming it incorrectly. I want to use the Cell instruction to display intermediate values of the code, but it doesn't do anything and actually causes the compiler/interpreter to stop and malfunction.

Please tell me how to invoke this instruction correctly.
0
Comment
Question by:Leonard Gojer
  • 4
  • 2
6 Comments
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
The Cells object is really a collection of all cells on the worksheet.  To use it for an individual cell, specify the row and column to get back a cell object, which you can then investigate.

ActiveSheet.Cells(1,1).value = 123
0
 

Author Comment

by:Leonard Gojer
Comment Utility
I tried

ActiveSheet.Cells(20 + count, 1).value = r1 ' r1 = 0.70345   count = 0

and the Cell in question did not show anything
0
 

Author Comment

by:Leonard Gojer
Comment Utility
I believe that you are telling me the truth, but I also believe that there is something else wrong with my spreadsheet that is causing this bug. That's what I don't like about VBA, it doesn't handle bugs like C# does.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 22

Accepted Solution

by:
rspahitz earned 500 total points
Comment Utility
Can you show the code you have that runs your command?

Do you know how to use the debugger and stop on that line to ensure that r1 has the correct value?
0
 

Author Comment

by:Leonard Gojer
Comment Utility
I even tried changing r1 to "123" and it did not work, because of other lines of code in the program that are causing the bug.

I don't want to take too much of your time, because I hired a programmer to help me with this.

Thank you for answering my question.
0
 

Author Closing Comment

by:Leonard Gojer
Comment Utility
Good job in answering me to the best of your abilities.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How does a lexer and parser works 2 77
no14 challenge 14 56
has12 challenge 13 58
Controlling which port to download from 4 57
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now