ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VLOOKUP (https://www.excelbanter.com/excel-programming/396106-vlookup.html)

Nena[_2_]

VLOOKUP
 
I would like to remove the N/A's and replace them with a 0 but none
of
these macros seem to be working properly. Two problems that I
encountered is that is (1) the macro does run but by replacing all
the
cells with a 0 (2) it does not stay within the data range, so it runs
through all the cells.

ActiveCell.FormulaR1C1 = "=IF(COUNTIF(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,)) VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)0))"
ActiveCell.Offset(0, 1).Select


Active.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)),0,VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE))"
ActiveCell.Offset(0, 1).Select


JE McGimpsey

VLOOKUP
 
Without seeing more of your macro, one can't really even hazard a guess,
since neither of your statements are syntactically correct or will
(directly) cause either of the problems you specify...



In article .com,
Nena wrote:

I would like to remove the N/A's and replace them with a 0 but none
of
these macros seem to be working properly. Two problems that I
encountered is that is (1) the macro does run but by replacing all
the
cells with a 0 (2) it does not stay within the data range, so it runs
through all the cells.

ActiveCell.FormulaR1C1 = "=IF(COUNTIF(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,)) VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)0))"
ActiveCell.Offset(0, 1).Select


Active.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)),0,VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE))"
ActiveCell.Offset(0, 1).Select


carloss

VLOOKUP
 
Use this formula

If(iserror(vlookup(a,b,c,d)),0,vlookup(a,b,c,d))

The "a,b,c,d" represents the parameters in your lookup

"JE McGimpsey" wrote:

Without seeing more of your macro, one can't really even hazard a guess,
since neither of your statements are syntactically correct or will
(directly) cause either of the problems you specify...



In article .com,
Nena wrote:

I would like to remove the N/A's and replace them with a 0 but none
of
these macros seem to be working properly. Two problems that I
encountered is that is (1) the macro does run but by replacing all
the
cells with a 0 (2) it does not stay within the data range, so it runs
through all the cells.

ActiveCell.FormulaR1C1 = "=IF(COUNTIF(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,)) VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)0))"
ActiveCell.Offset(0, 1).Select


Active.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)),0,VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE))"
ActiveCell.Offset(0, 1).Select



Nena[_2_]

VLOOKUP
 
Okay then what could I do to fix it? I simply want to replace the N/
A's with a 0 in it's place.

What would that macro look like?


On Aug 22, 12:15 pm, JE McGimpsey wrote:
Without seeing more of your macro, one can't really even hazard a guess,
since neither of your statements are syntactically correct or will
(directly) cause either of the problems you specify...

In article .com,



Nena wrote:
I would like to remove the N/A's and replace them with a 0 but none
of
these macros seem to be working properly. Two problems that I
encountered is that is (1) the macro does run but by replacing all
the
cells with a 0 (2) it does not stay within the data range, so it runs
through all the cells.


ActiveCell.FormulaR1C1 = "=IF(COUNTIF(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,)) VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)0))"
ActiveCell.Offset(0, 1).Select


Active.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)),0,VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE))"
ActiveCell.Offset(0, 1).Select- Hide quoted text -


- Show quoted text -




Don[_30_]

VLOOKUP
 

Selection.SpecialCells(xlCellTypeFormulas, 16).Value = 0

or instead of Selection.SpecialCells, you can use the actual
Range("??:??").SpecialCells so you never actually have to select the
cells.


On Aug 22, 11:39 am, Nena wrote:
Okay then what could I do to fix it? I simply want to replace the N/
A's with a 0 in it's place.

What would that macro look like?

On Aug 22, 12:15 pm, JE McGimpsey wrote:



Without seeing more of your macro, one can't really even hazard a guess,
since neither of your statements are syntactically correct or will
(directly) cause either of the problems you specify...


In article .com,


Nena wrote:
I would like to remove the N/A's and replace them with a 0 but none
of
these macros seem to be working properly. Two problems that I
encountered is that is (1) the macro does run but by replacing all
the
cells with a 0 (2) it does not stay within the data range, so it runs
through all the cells.


ActiveCell.FormulaR1C1 = "=IF(COUNTIF(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,)) VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)0))"
ActiveCell.Offset(0, 1).Select


Active.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)),0,VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE))"
ActiveCell.Offset(0, 1).Select- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -




SysAccountant

VLOOKUP
 
try

IF(ISNA(VLOOKUP(LookUpValue,lookupRange,ReturnColu mn,FALSE)),0,VLOOKUP(LookUpValue,lookupRange,Retur nColumn,FALSE))

It looks specifically for N/A ,and if true returns "0",else if performs an
additional VLookup

It works for me.

HTH

SysAccountant
"Nena" wrote:

Okay then what could I do to fix it? I simply want to replace the N/
A's with a 0 in it's place.

What would that macro look like?


On Aug 22, 12:15 pm, JE McGimpsey wrote:
Without seeing more of your macro, one can't really even hazard a guess,
since neither of your statements are syntactically correct or will
(directly) cause either of the problems you specify...

In article .com,



Nena wrote:
I would like to remove the N/A's and replace them with a 0 but none
of
these macros seem to be working properly. Two problems that I
encountered is that is (1) the macro does run but by replacing all
the
cells with a 0 (2) it does not stay within the data range, so it runs
through all the cells.


ActiveCell.FormulaR1C1 = "=IF(COUNTIF(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,)) VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)0))"
ActiveCell.Offset(0, 1).Select


Active.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE)),0,VLOOKUP(RC[-5],'Fall 2006 Cohort'!
R2C1:R65536C28,13,FALSE))"
ActiveCell.Offset(0, 1).Select- Hide quoted text -


- Show quoted text -






All times are GMT +1. The time now is 05:22 AM.

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