PC Review


Reply
Thread Tools Rate Thread

Application error

 
 
salgud
Guest
Posts: n/a
 
      5th Jun 2009
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
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      5th Jun 2009
maybe this

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

Regards,
Peter T

"salgud" <(E-Mail Removed)> wrote in message
news:7pk7a0ffw26$.i9a66zf183rs$.(E-Mail Removed)...
> 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



 
Reply With Quote
 
Sam Wilson
Guest
Posts: n/a
 
      5th Jun 2009
"=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
>

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      5th Jun 2009
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
>

 
Reply With Quote
 
salgud
Guest
Posts: n/a
 
      5th Jun 2009
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Service application Occurs Application Error Event ID 1000 =?Utf-8?B?VGVkZHk=?= Microsoft Dot NET Framework 1 11th Dec 2006 01:14 PM
The application, C:\WINDOWS\system32\lsass.exe, generated an application error The error occurred on 05/03/2004 @ 10:50:46.755 The exception generated was c0000005 at address 00900090 () =?Utf-8?B?cmljayBj?= Windows XP General 2 5th May 2004 03:36 AM
Event ID: 4097 - The application, explorer.exe, generated an application error mikasarg Microsoft Windows 2000 0 3rd Mar 2004 11:15 AM
'current custom error settings for application prevent details of application error from being viewed. ' Damian Microsoft ASP .NET 3 30th Dec 2003 08:01 PM
taskmgr.exe - application error . the application failed tointialize properly (0x0000005) Team-ReDX Microsoft Windows 2000 0 10th Jul 2003 09:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:27 PM.