Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default ISNA command in VBA

I have an excel sheet and I am have certin bits of information looked up from
a chart. For example, I would have a chart with totals from 2006, 2007, 2008.
The following line of code selets the total form 2006. It works fine.
However, when there is no value, #n/A is displayed. I know how to tell the
indiviual cell to display somethings. When I but it into code, i receive a
syntax error and the recorder does not work with this. How should the syntax
be?


Functional in excel sheet:
=IF(ISNA(OFFSET(A28,MATCH("TOTAL",A29:A143,0),MATC H(2006,A27:S27,0)-1,1,1)),"There
is no value for this year",(OFFSET(A28,MATCH("TOTAL",
A29:A143,0),MATCH(2007,A27:S27,0)-1,1,1)))

Who can I enter this information into VBA without getting a syntax error?




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default ISNA command in VBA

Hi BZeyger,

I'm not sure how much of that code you are trying to write in VBA. Here is
how you can test a cell to see if it is an error, and if it is then I have
tested to see if it is an #N/A error:

If IsError(Cells(1, 1).Value) Then
If Cells(1, 1) = CVErr(xlErrNA) Then
MsgBox ("#N/A ERROR in cell A1")
End If
End If

Is this what you were looking for?

If you are looking to use worksheet formulae in VBA then try using
Application.WorksheetFunction and then the function:
Application.WorksheetFunction.Match(Arg1,Arg2,Arg3 )

Sean.


--
(please remember to click yes if replies you receive are helpful to you)


"BZeyger" wrote:

I have an excel sheet and I am have certin bits of information looked up from
a chart. For example, I would have a chart with totals from 2006, 2007, 2008.
The following line of code selets the total form 2006. It works fine.
However, when there is no value, #n/A is displayed. I know how to tell the
indiviual cell to display somethings. When I but it into code, i receive a
syntax error and the recorder does not work with this. How should the syntax
be?


Functional in excel sheet:
=IF(ISNA(OFFSET(A28,MATCH("TOTAL",A29:A143,0),MATC H(2006,A27:S27,0)-1,1,1)),"There
is no value for this year",(OFFSET(A28,MATCH("TOTAL",
A29:A143,0),MATCH(2007,A27:S27,0)-1,1,1)))

Who can I enter this information into VBA without getting a syntax error?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ISNA Help Please Please please Mattlynn via OfficeKB.com Excel Worksheet Functions 6 March 8th 10 08:37 PM
IF(ISNA.... olrustyxlsuser Excel Discussion (Misc queries) 6 November 21st 08 11:46 PM
ISNA command in VBA BZeyger Excel Programming 0 October 22nd 07 06:54 PM
ISNA Help Bigfoot17 Excel Worksheet Functions 2 March 21st 07 05:58 PM
Using ISNA with OR HBF Excel Worksheet Functions 4 May 1st 06 10:37 PM


All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"