Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Organising sales data by month

Workbook Sales
(A1)Product (B1)Qty (C1)Date
X 2 2/1/2010
X 1 10/1/2010
X 3 5/3/2010
Y 1 8/1/2010
Y 2 5/2/2010
Y 1 3/3/2010
Y 1 5/3/2010
Z 2 3/2/2010
Z 1 5/3/2010

Workbook Report
SUMQTY
(A2)Product (B2)Mar10 (C2)Feb10 (D2)Jan10
X 3 0 3
Y 2 2 1
Z 1 2 0

Hi
Sales is a excel workbook from our sales system.
I would like some code to organise all the sales data found in Sales and
group it into monthly columns in a new excel file Report but being new to
vba I dont know where to start.
In the workbook Report:
I want B2 to be the current month and year (Mar10), C2 to be the current
month -1 (Feb10) and so on until I have 12 columns i.e 1 year.
Then I want the SUM of all the QTYs for each month for each product in the
correct column as shown above.
Can anyone help with the code?
Many thanks

Simon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 376
Default Organising sales data by month

Hi Simon

Don't use code, use a Pivot Table

Following instructions are for XL2003 (write back if you want XL2007)

Place cursor in your data data table on Sales
sheetDataListCreateclick my List has headers.
DataPivot TableFinish
On the new sheet created, with a PT skeleton
Drag Date to the Row area
Drag Product to the Row area
Drag Qty to the Data area

Place cursor on any DateRight clickGroup and OutlineGroupclick
Months and YearsOK
Drag Years to the Page area
Drag Months to the Column area

Having created a List first, the source data for the PT will grow
dynamically as you add more lines of data.
--
Regards
Roger Govier

Simon wrote:
Workbook Sales
(A1)Product (B1)Qty (C1)Date
X 2 2/1/2010
X 1 10/1/2010
X 3 5/3/2010
Y 1 8/1/2010
Y 2 5/2/2010
Y 1 3/3/2010
Y 1 5/3/2010
Z 2 3/2/2010
Z 1 5/3/2010

Workbook Report
SUMQTY
(A2)Product (B2)Mar10 (C2)Feb10 (D2)Jan10
X 3 0 3
Y 2 2 1
Z 1 2 0

Hi
Sales is a excel workbook from our sales system.
I would like some code to organise all the sales data found in Sales and
group it into monthly columns in a new excel file Report but being new to
vba I dont know where to start.
In the workbook Report:
I want B2 to be the current month and year (Mar10), C2 to be the current
month -1 (Feb10) and so on until I have 12 columns i.e 1 year.
Then I want the SUM of all the QTYs for each month for each product in the
correct column as shown above.
Can anyone help with the code?
Many thanks

Simon

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Organising sales data by month

Hi Roger
I am also pulling other data into the "report" from other spreadheets so
think I need to vba.

"Roger Govier" wrote:

Hi Simon

Don't use code, use a Pivot Table

Following instructions are for XL2003 (write back if you want XL2007)

Place cursor in your data data table on Sales
sheetDataListCreateclick my List has headers.
DataPivot TableFinish
On the new sheet created, with a PT skeleton
Drag Date to the Row area
Drag Product to the Row area
Drag Qty to the Data area

Place cursor on any DateRight clickGroup and OutlineGroupclick
Months and YearsOK
Drag Years to the Page area
Drag Months to the Column area

Having created a List first, the source data for the PT will grow
dynamically as you add more lines of data.
--
Regards
Roger Govier

Simon wrote:
Workbook âœSalesâ
(A1)Product (B1)Qty (C1)Date
X 2 2/1/2010
X 1 10/1/2010
X 3 5/3/2010
Y 1 8/1/2010
Y 2 5/2/2010
Y 1 3/3/2010
Y 1 5/3/2010
Z 2 3/2/2010
Z 1 5/3/2010

Workbook âœReportâ
SUMQTY
(A2)Product (B2)Mar10 (C2)Feb10 (D2)Jan10
X 3 0 3
Y 2 2 1
Z 1 2 0

Hi
âœSales❠is a excel workbook from our sales system.
I would like some code to organise all the sales data found in âœSales❠and
group it into monthly columns in a new excel file âœReport❠but being new to
vba I donât know where to start.
In the workbook âœReportâ:
I want B2 to be the current month and year (Mar10), C2 to be the current
month -1 (Feb10) and so on until I have 12 columns i.e 1 year.
Then I want the SUM of all the QTYs for each month for each product in the
correct column as shown above.
Can anyone help with the code?
Many thanks

Simon

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Organising data aquaxander Excel Discussion (Misc queries) 5 March 5th 09 12:33 PM
Sum multiple worksheet sales data by month RobS Excel Worksheet Functions 4 July 31st 08 06:20 PM
Month to date sales - reset in new month??? [email protected] Excel Worksheet Functions 2 November 26th 05 08:18 PM
re-organising a table of data Tim[_39_] Excel Programming 1 December 13th 04 11:04 PM


All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"