Create a macro
Solved/Closed
louannc
Posts
7
Registration date
Tuesday 6 August 2013
Status
Member
Last seen
21 August 2013
-
6 Aug 2013 à 17:01
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 8 Aug 2013 à 02:47
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 8 Aug 2013 à 02:47
Related:
- Create a macro
- Create gmail - Guide
- Create signature in thunderbird - Guide
- Create skype account - Guide
- Create blackberry id - Guide
- How to create a discord bot - Guide
3 responses
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
7 Aug 2013 à 04:26
7 Aug 2013 à 04:26
why macro?
see
http://speedy.sh/c3PRs/louannc.docx
if macro is reqd click record macro
follow lsteps
and stop recording
see the recorded macro and edit it if necessary
see
http://speedy.sh/c3PRs/louannc.docx
if macro is reqd click record macro
follow lsteps
and stop recording
see the recorded macro and edit it if necessary
louannc
Posts
7
Registration date
Tuesday 6 August 2013
Status
Member
Last seen
21 August 2013
7 Aug 2013 à 09:18
7 Aug 2013 à 09:18
Thank you for your input; however, a pivot table will not work for my needs. I simplified the spreadsheet, but there are over 25 columns on the spreadsheet, and I have to run a monthly report with all this info, and I need it to total the amounts for each #, Name in a separate column as I described on the spreadsheet. I was hoping that a I could run a macro each month that would auto total these for me. Is it possible? I would be grateful for any help anyone can give.
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
8 Aug 2013 à 02:47
8 Aug 2013 à 02:47
data is like this
number Name Amount Total
234 Brown, j 15
234 Brown, J 30
123 Junior, C 34
123 Junior, C 30
try this macro
number Name Amount Total
234 Brown, j 15
234 Brown, J 30
123 Junior, C 34
123 Junior, C 30
try this macro
Sub test()
Dim r1 As Range, c1 As Range, r As Range, filt As Range, filt1 As Range
Dim cfilt As Range, ssum As Double, j As Integer
Worksheets("sheet1").Activate
Range("E1").EntireColumn.Delete
Set r1 = Range(Range("A1"), Range("A1").End(xlDown))
Set r = Range("A1").CurrentRegion
r.Sort Key1:=Range("B1"), Header:=xlYes
Set filt = Range("A1").End(xlDown).Offset(5, 0)
r1.AdvancedFilter xlFilterCopy, , filt, True
Set filt = Range(filt.Offset(1, 0), filt.End(xlDown))
For Each cfilt In filt
r.AutoFilter field:=1, Criteria1:=cfilt
ssum = WorksheetFunction.Sum(r.Columns("D:D").SpecialCells(xlCellTypeVisible))
j = Range("d1").End(xlDown).Row
Cells(j, "E") = ssum
ssum = 0
Next cfilt
ActiveSheet.AutoFilterMode = False
Range(Range("A1").End(xlDown).Offset(1, 0), Cells(Rows.Count, "A")).EntireRow.Delete
End Sub