farhan_babu
New Member
- Joined
- Nov 19, 2005
- Messages
- 13
Hi,
I have written following code to get datewise sales total but there is any discrepency in this code.The 15 day of the month,s sales doesn,t appear.Is there any suggestion for this.Workbook has heavy data so I can,t attached it.
VBA:
Sub DaywiseSummary()
Application.ScreenUpdating = False
Dim i As Integer
'Dim COL As Integer
Dim ROO As Long
Dim ds As Date
' On Error Resume Next
'No of Required Sheets
For i = 1 To 13
ROO = 2
Sheets(i).Select
'First date of Month
ds = Range("A8")
Do
Sheets(i).Range("A1:A100").Find(What:=(ds), After:=Sheets(i).Cells(1, 1), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate
MsgBox ds
ActiveCell.Offset(0, 12).Select
Selection.Copy
'Summary Sheet
Sheets("Sheet1").Activate
'Date Column in Summary Sheet
Cells(ROO, 1) = ds
'Total Sales for the Day in Summary Sheet
Cells(ROO, 2).PasteSpecial xlPasteValues, xlAdd
Application.CutCopyMode = False
ROO = ROO + 1
ds = ds + 1
Sheets(i).Select
Loop Until Month(Sheets(i).Range("A8")) < Month(ds)
Next
Sheets("Sheet1").Activate
End Sub
Thanks in advance.
I have written following code to get datewise sales total but there is any discrepency in this code.The 15 day of the month,s sales doesn,t appear.Is there any suggestion for this.Workbook has heavy data so I can,t attached it.
VBA:
Sub DaywiseSummary()
Application.ScreenUpdating = False
Dim i As Integer
'Dim COL As Integer
Dim ROO As Long
Dim ds As Date
' On Error Resume Next
'No of Required Sheets
For i = 1 To 13
ROO = 2
Sheets(i).Select
'First date of Month
ds = Range("A8")
Do
Sheets(i).Range("A1:A100").Find(What:=(ds), After:=Sheets(i).Cells(1, 1), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate
MsgBox ds
ActiveCell.Offset(0, 12).Select
Selection.Copy
'Summary Sheet
Sheets("Sheet1").Activate
'Date Column in Summary Sheet
Cells(ROO, 1) = ds
'Total Sales for the Day in Summary Sheet
Cells(ROO, 2).PasteSpecial xlPasteValues, xlAdd
Application.CutCopyMode = False
ROO = ROO + 1
ds = ds + 1
Sheets(i).Select
Loop Until Month(Sheets(i).Range("A8")) < Month(ds)
Next
Sheets("Sheet1").Activate
End Sub
Thanks in advance.