#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 79
Default Total costing

Hello

I am working on a payment file
The first sheet called costing contains a list of all items that we
might purchase
A5 : List of Items
B5: month 31/12/2008
C5: 1/1/2009 etc
each month i entered the item and the total price of what we bought
each month has his own sheet
Sheet 31-12-2008 " B10=List of Items C10= Total amount
Sheet 1-1-2009 " B10=List of Items C10= Total amount

What i need is to have the total of each item for each month
N.B : each month i copy from the first sheet only the item that i used
not the same list in each sheet

Waiting for your reply

Thank you in advance
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,276
Default Total costing

Hi Tia,
If I didn't misunderstood you have the same problem as me in the past and
nice people from the comunity helped me with the code as per below, I this
was helpful please say yes, thanks

'Add a worksheet with the name "RDBMergeSheet"
Set DestSh = ActiveWorkbook.Worksheets.Add
DestSh.Name = "RDBMergeSheet"

'Fill in the start row
StartRow = 5

'loop through all worksheets and copy the data to the DestSh
For Each sh In ActiveWorkbook.Worksheets
If sh.Name < DestSh.Name And sh.Visible = True Then

'Find the last row with data on the DestSh and sh
Last = LastRow(DestSh)
shLast = LastRow(sh)

'If sh is not empty and if the last row = StartRow copy the
CopyRng
If shLast 0 And shLast = StartRow Then

'Set the range that you want to copy
Set CopyRng = sh.Range(sh.Range("A" & StartRow),
sh.Range("IV" & shLast))

'Test if there enough rows in the DestSh to copy all the data
If Last + CopyRng.Rows.Count DestSh.Rows.Count Then
MsgBox "There are not enough rows in the Destsh"
GoTo ExitTheSub
End If

'This example copies values/formats, if you only want to
copy the
'values or want to copy everything look below example 1 on
this page
CopyRng.Copy
With DestSh.Cells(Last + 1, "A")
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
End With

'Optional: This will copy the sheet name in the A column
'DestSh.Cells(Last + 1, "P").Resize(CopyRng.Rows.Count).Value =
sh.Name



End If

End If
Next

ExitTheSub:

Application.Goto DestSh.Cells(1)

'AutoFit the column width in the DestSh sheet
DestSh.Columns.AutoFit

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Sheets("Menu").Visible = True
Sheets("Menu").Select
ActiveCell.Range("A1").Select
End Sub


"Tia" wrote:

Hello

I am working on a payment file
The first sheet called costing contains a list of all items that we
might purchase
A5 : List of Items
B5: month 31/12/2008
C5: 1/1/2009 etc
each month i entered the item and the total price of what we bought
each month has his own sheet
Sheet 31-12-2008 " B10=List of Items C10= Total amount
Sheet 1-1-2009 " B10=List of Items C10= Total amount

What i need is to have the total of each item for each month
N.B : each month i copy from the first sheet only the item that i used
not the same list in each sheet

Waiting for your reply

Thank you in advance

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
costing values hugoalegria Excel Discussion (Misc queries) 8 February 6th 08 10:50 PM
costing hugoalegria Excel Discussion (Misc queries) 2 January 30th 08 08:58 PM
Product costing Lakshminarayana[_2_] Excel Worksheet Functions 4 August 12th 07 02:38 PM
Product costing Lakshminarayana[_2_] Excel Worksheet Functions 0 August 11th 07 06:20 AM
job costing worksheet leapyrgrl Excel Worksheet Functions 4 August 8th 05 10:13 PM


All times are GMT +1. The time now is 09:48 AM.

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

About Us

"It's about Microsoft Excel"