alpha character not populating in DBA table

T

Trebor

I am trying to debug an existing Excel program that is not pulling data from
one specific column in multiple worksheets. All other columns are numeric
data and populate correctly when the VB macro in run.

The cell formula below converts a numeric indicator from a separate
worksheet, to either the alpha character 'C' or leaves the cell blank.

=IF(VLOOKUP(A11,Usage,'Inputs-Usage'!$FF$6,FALSE)<>1,"C","")

The VB code in the macro module that provides the cell data to a .cvs file
is as follows;

''==== Per Steve, this should not be changed to Zero but should be null, or
real value, 09/13/2006
If IsError(Item.Range("Q" & intCounter).Address) = True Then
newVal = ""
Else
newVal = Item.Range("Q" & intCounter).Value
End If

Column 'Q' is the source for the alpha character to the .cvs file from which
the final report data is pulled.

The variable 'intCounter is as follows;

For intCounter = 9 To intNumberOfDayRows + 8

Can someone provide a possible solution to this problem.

Thank you
 
T

Tom Ogilvy

If IsError(Item.Range("Q" & intCounter).Address) = True Then
will never be true. An address can not be an error detectable by IsError.
If you mean the value in the cell (such as #N/A) then

If IsError(Item.Range("Q" & intCounter).Value) = True Then

Also, Item doesn't seem to be the best choice as an object variable since so
many objects have items as properties - it could make your code harder to
read and understand (or maybe not <g>).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top