Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Summary based on channel & date ranges

Hi,

In sheet1 I have Row 7 as header. From row 8 there is data.
In header have items in columnB, quantity in columnF, channel in
columnH & date in column I.


I want a routine which will give me a summary in sheet2 based on
channel selected and start/end date.
--------------------------------------------
Channel:<Select
Start Date:<Select
End Date:<Select


Items Quantity
A 10
B 30
C 60
D 90
E 80
F 70
--------------------------------------------

The quantity is sum of quantity date wise/channel wise.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Summary based on channel & date ranges

Sub make_summary()
StartDate = DateValue("1/1/08")
EndDate = Date 'today
ChanNum = 22

TotQuant = 0
With Sheets("Sheet1")
RowCount = 8
Do While .Range("B" & RowCount) < ""
If .Range("B" & RowCount) = ChanNum And _
.Range("I" & RowCount) = StartDate And _
.Range("I" & RowCount) <= EndDate Then

TotQuant = TotQuant + .Range("I" & RowCount)
End If
RowCount = RowCount + 1
Loop
End With
With Sheets("Sheet2")
Sht2LastRow = .Range("A" & Rows.Count). _
End(xlUp).Row
If Sht2LastRow = 1 Then
.Range("A1") = "Channel"
.Range("B1") = "Quantity"
Sht2NewRow = 2
Else
Sht2NewRow = Sht2LastRow + 1
End If
.Range("A" & Sht2NewRow) = ChanNum
.Range("B" & Sht2NewRow) = TotQuant

End With

End Sub


"Sinner" wrote:

Hi,

In sheet1 I have Row 7 as header. From row 8 there is data.
In header have items in columnB, quantity in columnF, channel in
columnH & date in column I.


I want a routine which will give me a summary in sheet2 based on
channel selected and start/end date.
--------------------------------------------
Channel:<Select
Start Date:<Select
End Date:<Select


Items Quantity
A 10
B 30
C 60
D 90
E 80
F 70
--------------------------------------------

The quantity is sum of quantity date wise/channel wise.

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
Formatting based on date ranges Rodney Excel Discussion (Misc queries) 2 July 20th 08 01:04 AM
Formatting based on date ranges Rodney Excel Discussion (Misc queries) 1 July 20th 08 12:58 AM
Conditional Format based on date ranges Corey Excel Worksheet Functions 4 July 31st 06 05:36 AM
Moving data based on date ranges Wendy Excel Worksheet Functions 1 July 6th 06 06:04 PM
Summary of Multiple Date Ranges Laura[_9_] Excel Programming 4 April 15th 04 08:31 AM


All times are GMT +1. The time now is 08:42 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"