ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2003 vs Excel 2007 #N/A in VB (https://www.excelbanter.com/excel-programming/440394-excel-2003-vs-excel-2007-n-vbulletin.html)

KMH

Excel 2003 vs Excel 2007 #N/A in VB
 
I have a very simple macro that works in Excel 2007 but hangs up constantly
in Excel 2003. Does anyone have a work around?

Problem:
When referencing cells that have a #N/A value, Excel 2003 craps out even if
I use the ISNA application function before it. The following 2 statements
will cause Excel 2003 VB to stop regardless of order if the cell that is
referenced comes up with #N/A.

Series = Cells(RowNumStart + X - 1, SeriesCol).Value
If WorksheetFunction.IsNA(Cells(RowNumStart + X - 1, ColNum)) Then

Further background.... I am actually wanting to find #N/A values to turn
"off" the data labels in a stacked bar chart if they are #N/A. In Excel
2007, this is not even required because it won't put #N/A values on the
chart, but Excel 2003 will continue to show them on the chart as 0 value
which clutters up the chart. My macro just checks the value and if a value
turns on the data label and if #N/A turns off the data label. Again, macro
works perfectly in Excel 2007 but I need to give to users who still have
Excel 2003.

Thanks for help


Peter T

Excel 2003 vs Excel 2007 #N/A in VB
 
See the reply I gave to your recent similar post on 3rd March, subject -
"Simple VBA Code Working in Excel 2007 but not Excel 2003 #N/A"

Regards,
Peter T

"KMH" wrote in message
...
I have a very simple macro that works in Excel 2007 but hangs up constantly
in Excel 2003. Does anyone have a work around?

Problem:
When referencing cells that have a #N/A value, Excel 2003 craps out even
if
I use the ISNA application function before it. The following 2 statements
will cause Excel 2003 VB to stop regardless of order if the cell that is
referenced comes up with #N/A.

Series = Cells(RowNumStart + X - 1, SeriesCol).Value
If WorksheetFunction.IsNA(Cells(RowNumStart + X - 1, ColNum))
Then

Further background.... I am actually wanting to find #N/A values to turn
"off" the data labels in a stacked bar chart if they are #N/A. In Excel
2007, this is not even required because it won't put #N/A values on the
chart, but Excel 2003 will continue to show them on the chart as 0 value
which clutters up the chart. My macro just checks the value and if a
value
turns on the data label and if #N/A turns off the data label. Again,
macro
works perfectly in Excel 2007 but I need to give to users who still have
Excel 2003.

Thanks for help




Rich Locus

Excel 2003 vs Excel 2007 #N/A in VB
 
Hello:

You could try using the IsError function:

If IsError(Cells(4,4).Value) Then
MsgBox("Cell in Error")
End IF
--
Rich Locus
Logicwurks, LLC


"KMH" wrote:

I have a very simple macro that works in Excel 2007 but hangs up constantly
in Excel 2003. Does anyone have a work around?

Problem:
When referencing cells that have a #N/A value, Excel 2003 craps out even if
I use the ISNA application function before it. The following 2 statements
will cause Excel 2003 VB to stop regardless of order if the cell that is
referenced comes up with #N/A.

Series = Cells(RowNumStart + X - 1, SeriesCol).Value
If WorksheetFunction.IsNA(Cells(RowNumStart + X - 1, ColNum)) Then

Further background.... I am actually wanting to find #N/A values to turn
"off" the data labels in a stacked bar chart if they are #N/A. In Excel
2007, this is not even required because it won't put #N/A values on the
chart, but Excel 2003 will continue to show them on the chart as 0 value
which clutters up the chart. My macro just checks the value and if a value
turns on the data label and if #N/A turns off the data label. Again, macro
works perfectly in Excel 2007 but I need to give to users who still have
Excel 2003.

Thanks for help


KMH

Excel 2003 vs Excel 2007 #N/A in VB
 
Thanks Peter, something is wrong with Microsoft Discussion Groups because it
is not notifying me of replies and when I search for my posts, it won't even
find them. I found this reply by going to Google searching not Microsoft.
Thanks again.

"Peter T" wrote:

See the reply I gave to your recent similar post on 3rd March, subject -
"Simple VBA Code Working in Excel 2007 but not Excel 2003 #N/A"

Regards,
Peter T

"KMH" wrote in message
...
I have a very simple macro that works in Excel 2007 but hangs up constantly
in Excel 2003. Does anyone have a work around?

Problem:
When referencing cells that have a #N/A value, Excel 2003 craps out even
if
I use the ISNA application function before it. The following 2 statements
will cause Excel 2003 VB to stop regardless of order if the cell that is
referenced comes up with #N/A.

Series = Cells(RowNumStart + X - 1, SeriesCol).Value
If WorksheetFunction.IsNA(Cells(RowNumStart + X - 1, ColNum))
Then

Further background.... I am actually wanting to find #N/A values to turn
"off" the data labels in a stacked bar chart if they are #N/A. In Excel
2007, this is not even required because it won't put #N/A values on the
chart, but Excel 2003 will continue to show them on the chart as 0 value
which clutters up the chart. My macro just checks the value and if a
value
turns on the data label and if #N/A turns off the data label. Again,
macro
works perfectly in Excel 2007 but I need to give to users who still have
Excel 2003.

Thanks for help



.


Peter T

Excel 2003 vs Excel 2007 #N/A in VB
 
Unfortunately MS's WebNews is not a good interface in which to access these
groups. I don't think 'notify replies' has ever worked and search is flaky.
Need to make a note of when you posted (adjusted to PST) and navigate pages.

Most of the regulars use a Newsreader such as Outlook Express, LiveMail or
one of several other 3rd party apps (set up a news account to server name
"msnews.microsoft.com" and go from there). Otherwise there are several other
web interfaces, not least Google Groups.

Regards,
Peter T


"KMH" wrote in message
...
Thanks Peter, something is wrong with Microsoft Discussion Groups because
it
is not notifying me of replies and when I search for my posts, it won't
even
find them. I found this reply by going to Google searching not Microsoft.
Thanks again.

"Peter T" wrote:

See the reply I gave to your recent similar post on 3rd March, subject -
"Simple VBA Code Working in Excel 2007 but not Excel 2003 #N/A"

Regards,
Peter T

"KMH" wrote in message
...
I have a very simple macro that works in Excel 2007 but hangs up
constantly
in Excel 2003. Does anyone have a work around?

Problem:
When referencing cells that have a #N/A value, Excel 2003 craps out
even
if
I use the ISNA application function before it. The following 2
statements
will cause Excel 2003 VB to stop regardless of order if the cell that
is
referenced comes up with #N/A.

Series = Cells(RowNumStart + X - 1, SeriesCol).Value
If WorksheetFunction.IsNA(Cells(RowNumStart + X - 1,
ColNum))
Then

Further background.... I am actually wanting to find #N/A values to
turn
"off" the data labels in a stacked bar chart if they are #N/A. In
Excel
2007, this is not even required because it won't put #N/A values on the
chart, but Excel 2003 will continue to show them on the chart as 0
value
which clutters up the chart. My macro just checks the value and if a
value
turns on the data label and if #N/A turns off the data label. Again,
macro
works perfectly in Excel 2007 but I need to give to users who still
have
Excel 2003.

Thanks for help



.





All times are GMT +1. The time now is 07:11 PM.

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