Monday, September 27, 2010

Data imported from SAP converts dates to text

It is a common problem to find that when you import data from other data sources into Excel, the dates are converted to text. Most times this is data being retrieved for the monthly reporting cycle and there are very strict deadlines to produce the management reports. Most Business Analysts spend their nights in the office to address such mundane problems.

Date problems are best addressed using a combination of Excel Date and Text functions. Sometimes you may need to incorporate a Excel Boolean functions. An example is =IF(ISERROR(DATE(YEAR(D2),MONTH(D2),DAY(D2))),DATE(RIGHT(D2,4),LEFT(D2,2),MID(D2,4,2)),DATE(YEAR(D2),MONTH(D2),DAY(D2)))

Wednesday, September 22, 2010

Automate printing of multiple sheets in Excel

I once received this request from a Finance Manager. He had this Excel file with close to 10 worksheets and he only needed to print 6 of the worksheets every month during the management meetings. He needed to print ALL the 6 sheets without having to do it one at a time. This sounded simple, but when I looked at the options for printing in Excel it was not going to be possible.

I therefore developed a macro that would print each of the 6 worksheets in sequence. This I later modified to print a list of selected worksheets based on the users preferences.