Solved

Explanation of cells function in Excel VB

Posted on 2014-09-03
3
135 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 47

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

685 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