Hi. I am trying to create a diary in excel. I can do it long handed but will take hours and I'm sure there is an easier route for this. This is what I would like:
A4 page in landscape with date and day centred at top of page, below this are 6 Columns ( paid, description, job #, invoice #, size, use). Columns are not same size - but can be sorted later.
What I am after is a script or macro that I can run and will let me enter a range of dates and then print off a single page for each of that days in that range in the format above
Would be very grateful if anybody can help
Cheers
Something like this:
Sub test() Dim strStartDate As String Dim strEndDate As String Dim lngLoopDate As Long strStartDate = InputBox("Enter start date") strEndDate = InputBox("Enter end date") For lngLoopDate = DateValue(strStartDate) To DateValue(strEndDate) With Sheets("Diary") .Range("A1").Value = lngLoopDate .PrintOut End With Next lngLoopDate End Sub
Change the sheet name and cell to populate as required.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Many thanks for your quick reply. I will try out and let you know
Thanks again for speedy reply.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks