Please help macro or formula excel
Solved/Closed
talkwutty
Posts
2
Registration date
Friday 16 April 2010
Status
Member
Last seen
16 April 2010
-
16 Apr 2010 à 11:58
talkwutty Posts 2 Registration date Friday 16 April 2010 Status Member Last seen 16 April 2010 - 16 Apr 2010 à 19:52
talkwutty Posts 2 Registration date Friday 16 April 2010 Status Member Last seen 16 April 2010 - 16 Apr 2010 à 19:52
Related:
- Please help macro or formula excel
- Formula to calculate vat in excel - Guide
- Excel online macros - Guide
- Number to words in excel formula - Guide
- Grade formula in excel marksheet - Guide
- Logitech formula vibration feedback wheel driver - Download - Drivers
1 response
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
16 Apr 2010 à 13:34
16 Apr 2010 à 13:34
Assumptions
1. Data is on Sheet1
2. Total is to be calculated on Sheet2, which exists
1. Data is on Sheet1
2. Total is to be calculated on Sheet2, which exists
Sub SummaryReport()
Dim lMaxRows As Long
Dim lMaxRows1 As Long
lMaxRows = Cells(Rows.Count, "A").End(xlUp).Row
With Range(Cells(1, "E"), Cells(lMaxRows, "E"))
.FormulaR1C1 = "=RC1 & ""|"" & RC2 & ""|"" & RC3"
.Copy
.PasteSpecial xlPasteValues
End With
Sheets("Sheet2").Range("A1:A" & lMaxRows) = Range(Cells(1, "E"), Cells(lMaxRows, "E")).Value
Sheets("Sheet2").Select
Columns("A:A").Select
Application.CutCopyMode = False
Columns("A:A").Select
Selection.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("B1"), Unique:=True
Columns("A:A").Delete
lMaxRows1 = Cells(Rows.Count, "A").End(xlUp).Row
Range("D1") = "Monthy Total"
With Range(Cells(2, "D"), Cells(lMaxRows1, "D"))
.FormulaR1C1 = "=SUMIF(Sheet1!C5:C5,Sheet2!RC1,Sheet1!C4:C4)"
.Copy
.PasteSpecial xlPasteValues
End With
Columns("A:A").Select
Selection.TextToColumns _
Destination:=Range("A1"), _
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, _
Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar:="|", _
FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1)), _
TrailingMinusNumbers:=True
Sheets("Sheet1").Select
Range(Cells(1, "E"), Cells(lMaxRows, "E")).Clear
End Sub
16 Apr 2010 à 19:52