Solved

Explanation of cells function in Excel VB

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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