VBA Help

yogin2

New Member
Joined
Jun 7, 2008
Messages
41
The code below allows me to run a macro and print the requested details.

What I wanted was when the macro is run, after it runs the following command. With Sheets("Days Daily Sheet") to prompt the user to enter the date, currently the date is set as default.

Sub OutloadingDays()
'
' OutloadingDays Macro
'
With Sheets("Days Daily Sheet")
.Range("D2") = Date
.Range("$B$4:$D$86").AutoFilter Field:=3, Criteria1:="DL"
.PrintOut Copies:=1
Sheets("Macro's").Select
End With
End Sub

Thanks

Yogin
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try

Code:
Sub OutloadingDays()
'
' OutloadingDays Macro
'
Dim MyDate As Date, StringDate As String
With Sheets("Days Daily Sheet")
    StringDate = InputBox("Enter Date")
    If IsDate(StringDate) Then
        MyDate = DateValue(StringDate)
        .Range("D2") = MyDate
    Else
        MsgBox "Invalid date"
        Exit Sub
    End If
    .Range("$B$4:$D$86").AutoFilter Field:=3, Criteria1:="DL"
    .PrintOut Copies:=1
    Sheets("Macro's").Select
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,537
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top