Calendar to track customer loaner vehicles

dsal66

New Member
Joined
Feb 7, 2019
Messages
1
I am trying to develop a macro in VBA to manage loaner vehicles for an automotive service department (see sample below). This is what I have put together so far, obviously it doesn't work:

Sub Duplicate_Entries_Based_on_Return_Date()
Dim lastrow As Long

'Find the Last Row
lastrow = Range("D3").CurrentRegion.Rows.Count

'Select Table
Range("D3:J" & lastrow).Select

'Filter Table
Selection.AutoFilter Field#4, Criteria1:=">Field#3"

'Copy/Paste
Selection.Copy
Sheets("March2019").Range("K3").PasteSpecial xlPasteValues

'Turn off autofilter
Selection.AutoFilter


End Sub

A critical component of the macro must be to compare the PICKUP DATE to the RETURN DATE, for each loaner vehicle, and automatically copy/paste the entry into the next day, or days, based on duration of repairs. It must also allow for the user to update return date(s) as needed. I have structured the workbook with separate sheets for each month. Each month data fields all run horizontally. Below is a snapshot of current format. Also, I have drop down menus, not sure if they will impact the macro.
 
Last edited by a moderator:

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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