ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   alpha character not populating in DBA table (https://www.excelbanter.com/excel-programming/393967-alpha-character-not-populating-dba-table.html)

Trebor[_2_]

alpha character not populating in DBA table
 
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
--
TWN

Tom Ogilvy

alpha character not populating in DBA table
 
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).

--
Regards,
Tom Ogilvy

"Trebor" wrote:

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
--
TWN


Trebor[_2_]

alpha character not populating in DBA table
 
Thanks for the comments Mr O. I will keep chipping away at this code.
--
TWN


"Tom Ogilvy" wrote:

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).

--
Regards,
Tom Ogilvy

"Trebor" wrote:

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
--
TWN



All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com