Solved

Staff Holiday Record Macro

Posted on 2008-06-20
11
1,014 Views
Last Modified: 2012-05-05
On the attached .xls I would like to build a macro which shows me on sheet 2, 6 months in advance who will be off, but necer show previous dates.  The columns in sheet 2 should show the following:

1.  Date = 1-999 which dates are coming up first at the top.
2.  Day = Monday/Tuesday etc.
3.  Time off should pull the data from sheet 1 to show how long they are off for i.e. 1 day .5 day etc.
4.  The staff names = Just put the word 'Yes' in the row under the member of staff it corresponds to.

Any help is greatly appreciated.
Holiday-Chart-2008-to-2009.xls
0
Comment
Question by:Simonrepro
  • 5
  • 5
11 Comments
 
LVL 24

Expert Comment

by:purplepomegranite
ID: 21830131
The attached file works as you have requested.  To update the summary sheet, just run the macro CreateSummaryForecast.

I would have added a button to click to be able to do this... but embarrassingly I still haven't worked out how to add buttons to worksheets using Excel 2007...
Holiday-Chart-2008-to-2009.xls
0
 
LVL 6

Expert Comment

by:Jaffa0
ID: 21830196
Go to Excel options and enable 'Show Developer tab in Ribbon' no the Popular page. You can add controls from there.
0
 

Author Comment

by:Simonrepro
ID: 21830198
This is great just one problem, the line below is in yellow?

ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Clear
0
 

Author Comment

by:Simonrepro
ID: 21830210
Also only need to see dates after current date i.e. today I would not expect to see anything from before 20/06/08
0
 

Author Comment

by:Simonrepro
ID: 21830234
I can't find a button called 'Options'
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 24

Expert Comment

by:purplepomegranite
ID: 21830258
Oh, yes, forgot about current date.  Will adjust.

Jaffa0's comment was to me, I think, re. Excel 2007.  Will try that... thanks!!
0
 
LVL 24

Expert Comment

by:purplepomegranite
ID: 21830307
The ribbon thing worked great - thanks Jaffa0, I've been wondering about that for ages!  Though I did still forget to add the button, I've just realised.

Amended code attached that only shows dates yet to occur.

If the line is in yellow, you are in break mode for some reason.  Did you receive an error or something?  Shouldn't be in break mode unless you press <CTRL><BREAK>
Holiday-Chart-2008-to-2009.xls
0
 
LVL 24

Expert Comment

by:purplepomegranite
ID: 21830431
The attached has a button on the first sheet for convenience.
Holiday-Chart-2008-to-2009.xls
0
 

Author Comment

by:Simonrepro
ID: 21830537
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Clear

When I click create summary it says run time error 438 the object does not support this property or method and
The above line is still in yellow
0
 
LVL 24

Accepted Solution

by:
purplepomegranite earned 500 total points
ID: 21830593
Ok, I've amended the sort code.  There were changes made to VBA with regards to the sort between earlier versions of Excel and 2007.  I have rewritten it so that it should be compatible now.
Holiday-Chart-2008-to-2009.xls
0
 

Author Comment

by:Simonrepro
ID: 21831089
That's great many thanks!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now