+ Reply to Thread
Results 1 to 3 of 3

Thread: Macro to automate and organize diary entries

  1. #1
    Registered User
    Join Date
    08-30-2011
    Location
    Eastbourne
    MS-Off Ver
    Excel 2010
    Posts
    2

    Smile Macro to automate and organize diary entries

    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

  2. #2
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: Macro to automate and organize diary entries

    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.

  3. #3
    Registered User
    Join Date
    08-30-2011
    Location
    Eastbourne
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to automate and organize diary entries

    Many thanks for your quick reply. I will try out and let you know

    Thanks again for speedy reply.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0