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...
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"
...
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 ...
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 ...
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......
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 ...
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 Save_DAILY_REPORT() > ActiveWorkbook.SaveAs Filename:="C:\Daily Report\" & _ >...
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 persisting in your path, though you forfeit the little, you gain the > great. >...
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" Case 2 To 6 strFName = "C:\Daily Report\" & Format(Date,...
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@microsoft.com... > Thanks for your quick response Jacob. I first got the end if block error. > I >...
Related threads on "Discussions in microsoft.public.excel.programming":
Cannot Get Instance of Com component... Cannot Get Instance of Com component
Microsoft.Office.Interop.Excel.Worksheet with Excel Interface Error. in
microsoft.public.excel.programming
Microsoft Excel Training: Microsoft Excel Training -... Microsoft Excel Training: Microsoft Excel Training - Training Resources For Microsoft Excel. Master Microsoft Ex.. http://tinyurl.com/ayr45h 3:23 PM Dec 24th, 2008 from twitterfeed
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