Excel Macro help
Closed
DDTEmp
Posts
1
Registration date
Thursday 26 March 2009
Status
Member
Last seen
27 March 2009
-
27 Mar 2009 à 11:56
WutUp WutUp - 1 Apr 2009 à 19:43
WutUp WutUp - 1 Apr 2009 à 19:43
Related:
- Excel Macro help
- Excel mod apk for pc - Download - Spreadsheets
- Excel online macros - Guide
- How to run a macro in excel - Guide
- Vat calculation excel - Guide
- Kernel for excel repair - Download - Backup and recovery
2 responses
buster23
Posts
15
Registration date
Monday 29 December 2008
Status
Member
Last seen
3 June 2009
2
28 Mar 2009 à 03:28
28 Mar 2009 à 03:28
hi,
try this link to get tutorials about using excel macros:
https://www.helpwithpcs.com/software/microsoft-excel-macro-tutorial.php
this will help you.
try this link to get tutorials about using excel macros:
https://www.helpwithpcs.com/software/microsoft-excel-macro-tutorial.php
this will help you.
This assumes that there is a heading in the first row, and your data you want to filter for unique records is in
column A. This uses the advanced filter to extract the unique records to column J. Then, it will copy and paste
values to column K and delete the "extract" from column J so the countif formula can be used. You said a
chart will need to be made from this information that is why the table will be created to the right of the data
within the same spreadsheet. Once the table is set-up, you can create a chart from there. You can change the
ranges (or columns) to suit your spreadsheet.
Hope this helps!
Sub CreateList()
Dim List
List = 2
Range("A2:A2000").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("J2"), Unique:=True
Columns("J").Select
Selection.Copy
Range("K1").Select
Selection.PasteSpecial Paste:=xlPasteValues
Columns("J").ClearContents
Application.CutCopyMode = False
Do Until Range("K" & List) = ""
Range("L" & List) = "=countif(A2:A2000,K" & List & ")"
List = List + 1
Loop
Range("M2").Select
End Sub
column A. This uses the advanced filter to extract the unique records to column J. Then, it will copy and paste
values to column K and delete the "extract" from column J so the countif formula can be used. You said a
chart will need to be made from this information that is why the table will be created to the right of the data
within the same spreadsheet. Once the table is set-up, you can create a chart from there. You can change the
ranges (or columns) to suit your spreadsheet.
Hope this helps!
Sub CreateList()
Dim List
List = 2
Range("A2:A2000").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("J2"), Unique:=True
Columns("J").Select
Selection.Copy
Range("K1").Select
Selection.PasteSpecial Paste:=xlPasteValues
Columns("J").ClearContents
Application.CutCopyMode = False
Do Until Range("K" & List) = ""
Range("L" & List) = "=countif(A2:A2000,K" & List & ")"
List = List + 1
Loop
Range("M2").Select
End Sub