Solved

Explanation of cells function in Excel VB

Posted on 2014-09-03
3
131 Views
Last Modified: 2014-09-04
Experts,

If i = 420    and    j =1
Can you tell me what this command says:

 If Cells(i + 2, j * 2 + 1) <> 0 And Len(Cells(i + 2, j * 2 + 1)) > 0 Then GoTo notDelete
0
Comment
Question by:morinia
3 Comments
 
LVL 46

Assisted Solution

by:Martin Liss
Martin Liss earned 167 total points
ID: 40302350
It says "If the cell in row 422 and column 3 (because J is 1 and 1 x 2 plus 1 is 3)  is not zero and the length is greater than 0 the go to notDelete". BTW goto used like that is IMO poor programming.
0
 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 166 total points
ID: 40302364
No points, just restating:

If C422 is not equal to zero, AND if the number of characters in C422 is more than zero, then goto "notDelete."

I agree with Martin that the use of GoTo should be avoided.  Perhaps the logic can be changed in this test so that the lines between this test and "notDelete" are executed instead.  

-Glenn
0
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 167 total points
ID: 40303098
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

21 Experts available now in Live!

Get 1:1 Help Now