Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Simplify save code in microsoft.public.excel.programming

Started 1 month, 2 weeks ago by DavidH56
Hi, Thanks all of you experts for being such a great help in solving my programming issues. I would like to know the best method for simplyfying this bit of code: Private Sub Save_DAILY_REPORT() 'TO SAVE REPORT FILE If Weekday(Now()) = 1 Then _ ActiveWorkbook.SaveAs Filename:= _ "C:\Daily...
Site: Discussions in microsoft.public.excel.programming  Discussions in microsoft.public.excel.programming - site profile
Forum: microsoft.public.excel.programming  microsoft.public.excel.programming - forum profile
Total authors: 4 authors
Total thread posts: 7 posts
Thread activity: no new posts during last week
Domain info for: microsoft.com

Other posts in this thread:

Matthew Herbert replied 1 month, 2 weeks ago
DavidH56, Try something along the lines of what is listed below. (The code is untested). Best, Matthew Herbert Dim strFName As String Select Case Weekday(Now()) Case 1, 7 strFName = "C:\Daily Report\Archives\DAILY REPORT" & Format(Date, "dd-mmm-yyyy") & ".xls" ...

Jacob Skaria replied 1 month, 2 weeks ago
Try the below Private Sub Save_DAILY_REPORT() ActiveWorkbook.SaveAs Filename:="C:\Daily Report\" & _ IIf(Left(Format(Date - 5, "ddd"), 1) = "S", "Archives", _ Format(Date, "dddd")) & "\DAILY REPORT" & _ Format(Date, "dd-mmm-yyyy") & ".xls", FileFormat:=xlNormal End If If this post helps click Yes ...

DavidH56 replied 1 month, 2 weeks ago
Thanks Matthew for such a quick response. This is exactly what I was looking for. Works great. Thanks a million once again. -- By persisting in your path, though you forfeit the little, you gain the great. "Matthew Herbert" wrote: > DavidH56, > > Try something along the lines of what is ...

DavidH56 replied 1 month, 2 weeks ago
Thanks for your quick response Jacob. I first got the end if block error. I changed spelling for the first if. I now get syntax error. Thanks -- By persisting in your path, though you forfeit the little, you gain the great. "Jacob Skaria" wrote: > Try the below > > Private Sub ...

JLGWhiz replied 1 month, 2 weeks ago
Just a note for the OP edification. IIf() is a good VBA syntax. Returns one of two parts, depending on the evaluation of an expression. Syntax IIf(expr, truepart, falsepart) "DavidH56" <DavidH56@discussions.microsoft.com> wrote in message news:874AF160-9411-492F-A526-CD3574226CC8@micros oft.com......

Jacob Skaria replied 1 month, 2 weeks ago
Did you copy/paste the code? or modified. If this post helps click Yes --------------- Jacob Skaria "DavidH56" wrote: > Thanks for your quick response Jacob. I first got the end if block error. I > changed spelling for the first if. I now get syntax error. > > Thanks > -- > By ...

 

Top contributing authors

Name
Posts
DavidH56
3
user's latest post:
Simplify save code in...
Published (2009-11-10 11:08:00)
&nbsp; Thanks for your quick response Jacob. I first got the end if block error. I changed spelling for the first if. I now get syntax error. Thanks -- By persisting in your path, though you forfeit the little, you gain the great. &quot;Jacob Skaria&quot; wrote: &gt; Try the below &gt; &gt; Private Sub Save_DAILY_REPORT() &gt; ActiveWorkbook.SaveAs Filename:=&quot;C:\Daily Report\&quot; &amp; _ &gt;...
Jacob Skaria
2
user's latest post:
Simplify save code in...
Published (2009-11-10 22:35:00)
&nbsp; Did you copy/paste the code? or modified. If this post helps click Yes --------------- Jacob Skaria &quot;DavidH56&quot; wrote: &gt; Thanks for your quick response Jacob. I first got the end if block error. I &gt; changed spelling for the first if. I now get syntax error. &gt; &gt; Thanks &gt; -- &gt; By persisting in your path, though you forfeit the little, you gain the &gt; great. &gt;...
Matthew Herbert
1
user's latest post:
Simplify save code in...
Published (2009-11-10 10:51:00)
&nbsp; DavidH56, Try something along the lines of what is listed below. (The code is untested). Best, Matthew Herbert Dim strFName As String Select Case Weekday(Now()) Case 1, 7 strFName = &quot;C:\Daily Report\Archives\DAILY REPORT&quot; &amp; Format(Date, &quot;dd-mmm-yyyy&quot;) &amp; &quot;.xls&quot; Case 2 To 6 strFName = &quot;C:\Daily Report\&quot; &amp; Format(Date,...
JLGWhiz
1
user's latest post:
Simplify save code in...
Published (2009-11-10 20:21:00)
&nbsp; Just a note for the OP edification. IIf() is a good VBA syntax. Returns one of two parts, depending on the evaluation of an expression. Syntax IIf(expr, truepart, falsepart) &quot;DavidH56&quot; &lt;DavidH56@discussions.microsoft.com&gt; wrote in message news:874AF160-9411-492F-A526-CD3574226CC8@microsoft.com... &gt; Thanks for your quick response Jacob. I first got the end if block error. &gt; I &gt;...

Related threads on "Discussions in microsoft.public.excel.programming":

Related threads on other sites:

Thread profile page for "Simplify save code in microsoft.public.excel.programming" on http://www.microsoft.com/communities/newsgroups.... This report page is a snippet summary view from a single thread "Simplify save code in microsoft.public.excel.programming", located on the Message Board at http://www.microsoft.com/communities/newsgroups.... This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity