Advertisement

09.25.2008 at 12:39PM PDT, ID: 23763951 | Points: 250
[x]
Attachment Details

Insert Data into Spreadsheets

Asked by commonpurpose in Microsoft Excel Spreadsheet Software, SQL Server 2005, SSIS

Tags: , ,

We initially tried this via SQL 2005 SSIS but now resorting to something that Excel/VB could do for us

We have a single worksheet workbook which has a dump of data from a database. First row is headers, first column contains account codes (strings) the next 12 columns are Period1, Period2, Period3, etc of the financial year (floats).

We then have a number of workbooks in a directory which contain multiple worksheets but always have one called 'Forecast' which is the one we are interested in. This sheet also has a column containing account codes (strings) and 12 columns of float data for each period of the year.

We need something to:

Loop through the directory of these workbooks Open the first one and use the Forecast sheet Find the first account code in a specified range of rows Search for a matching entry for this account code in the account code column of the data worksheet If a match is found and > 0, write the period1 value of that row back to the period1 value in the Forecast sheet for the row we are currently on Keep offsetting by one column for each period and write back if > 0 Move to the next account code Once hit the bottom of the range of account codes, close the current workbook with Save and open the next in the loop
Start Free Trial
[+][-]09.26.2008 at 12:38AM PDT, ID: 22577346

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.26.2008 at 02:12AM PDT, ID: 22577735

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.26.2008 at 04:48AM PDT, ID: 22578459

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.26.2008 at 04:56AM PDT, ID: 22578515

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.26.2008 at 05:52AM PDT, ID: 22578908

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.30.2008 at 02:33AM PDT, ID: 22603738

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 07:38AM PDT, ID: 22624650

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 08:02AM PDT, ID: 22624931

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.03.2008 at 01:39AM PDT, ID: 22632072

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.04.2008 at 12:14PM PDT, ID: 22641945

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.19.2008 at 01:06PM PDT, ID: 22753535

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.19.2008 at 01:09PM PDT, ID: 22753549

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.28.2008 at 11:22PM PST, ID: 23058899

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628