ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting rid of "#VALUE!" (https://www.excelbanter.com/excel-programming/381070-getting-rid-value.html)

[email protected]

Getting rid of "#VALUE!"
 
I have 2 columns: (the first column is user defined while the second is
returned through the macro)

Last Login | Days Since Last Login
1/1/2007 11
N/A #Value!


I get the # value after running this macro

Macro

'Populates the Days Since column with data
Set rng = Range(Cells(2, 2), Cells(2, 2).End(xlDown))
rng.Offset(0, 5).Formula = "=Networkdays(F2,today())"




How do I get rid of the #Value! ? I can't do a Find and Replace since
#Value! isn't text but an error message.


Chip Pearson

Getting rid of "#VALUE!"
 
=IF(ISERROR("=Networkdays(F2,today()),"","=Network days(F2,today())

Not quite right. Try

=IF(ISERROR(NETWORKDAYS(F2,TODAY())),"",NETWORKDAY S(F2,TODAY()))

In Excel 2007, you can use the new IFERROR function.

=IFERROR(NETWORKDAYS(F2,TODAY()),"")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"geebee" (noSPAMs) wrote in message
...
hi,

Adapt this formula for each cell you want to replace the #Value!, to your
needs:
=IF(ISERROR("=Networkdays(F2,today()),"","=Network days(F2,today())


Hope this helps,
geebee


" wrote:

I have 2 columns: (the first column is user defined while the second is
returned through the macro)

Last Login | Days Since Last Login
1/1/2007 11
N/A #Value!


I get the # value after running this macro

Macro

'Populates the Days Since column with data
Set rng = Range(Cells(2, 2), Cells(2, 2).End(xlDown))
rng.Offset(0, 5).Formula = "=Networkdays(F2,today())"




How do I get rid of the #Value! ? I can't do a Find and Replace since
#Value! isn't text but an error message.






All times are GMT +1. The time now is 12:17 PM.

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