ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application error (https://www.excelbanter.com/excel-programming/429434-application-error.html)

salgud

Application error
 
Does anybody see what's wrong with this code:

with ws
.Cells(7, 10).Formula =
"=IF(.cells(7,8)<"""",DATEDIF(.cells(7,8),.cells( 7,9),""d"")+1)"
end with

Thanks

Peter T

Application error
 
maybe this

ws.Cells(7, 10).Formula = "=IF($H$7<"""",DATEDIF($H$7,$I$7,""d"")+1)"

Regards,
Peter T

"salgud" wrote in message
...
Does anybody see what's wrong with this code:

with ws
.Cells(7, 10).Formula =
"=IF(.cells(7,8)<"""",DATEDIF(.cells(7,8),.cells( 7,9),""d"")+1)"
end with

Thanks




Peter T

Application error
 
maybe this

ws.Cells(7, 10).Formula = "=IF($H$7<"""",DATEDIF($H$7,$I$7,""d"")+1)"

Regards,
Peter T

"salgud" wrote in message
...
Does anybody see what's wrong with this code:

with ws
.Cells(7, 10).Formula =
"=IF(.cells(7,8)<"""",DATEDIF(.cells(7,8),.cells( 7,9),""d"")+1)"
end with

Thanks




Sam Wilson

Application error
 
"=IF(" & .cells(7,8).address & "<"""",DATEDIF(" & .cells(7,8).address & ","
& .cells(7,9).address & ",""d"")+1)"


"salgud" wrote:

Does anybody see what's wrong with this code:

with ws
.Cells(7, 10).Formula =
"=IF(.cells(7,8)<"""",DATEDIF(.cells(7,8),.cells( 7,9),""d"")+1)"
end with

Thanks


Gary''s Student

Application error
 
stuff like With and .Cells() works in VBA, but not in a worksheet formula.
--
Gary''s Student - gsnu200856


"salgud" wrote:

Does anybody see what's wrong with this code:

with ws
.Cells(7, 10).Formula =
"=IF(.cells(7,8)<"""",DATEDIF(.cells(7,8),.cells( 7,9),""d"")+1)"
end with

Thanks


salgud

Application error
 
On Fri, 5 Jun 2009 08:38:42 -0600, salgud wrote:

Does anybody see what's wrong with this code:

with ws
.Cells(7, 10).Formula =
"=IF(.cells(7,8)<"""",DATEDIF(.cells(7,8),.cells( 7,9),""d"")+1)"
end with

Thanks


I think I figured it out. Can't do a ws.cells in a worksheet formula. Think
I have to do and offset instead. Any other ways?

salgud

Application error
 
On Fri, 5 Jun 2009 08:38:42 -0600, salgud wrote:

Does anybody see what's wrong with this code:

with ws
.Cells(7, 10).Formula =
"=IF(.cells(7,8)<"""",DATEDIF(.cells(7,8),.cells( 7,9),""d"")+1)"
end with

Thanks


I think I figured it out. Can't do a ws.cells in a worksheet formula. Think
I have to do and offset instead. Any other ways?


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

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