Create a macro
Closed
louannc
Posts
7
Registration date
Tuesday August 6, 2013
Status
Member
Last seen
August 21, 2013
-
Aug 14, 2013 at 12:29 PM
louannc Posts 7 Registration date Tuesday August 6, 2013 Status Member Last seen August 21, 2013 - Aug 21, 2013 at 09:59 AM
louannc Posts 7 Registration date Tuesday August 6, 2013 Status Member Last seen August 21, 2013 - Aug 21, 2013 at 09:59 AM
Related:
- Create a macro
- Create skype account with gmail - Guide
- Create snapchat account - Guide
- Create hotmail account - Guide
- Create instagram account on pc - Guide
- Create samsung account - Guide
4 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 15, 2013 at 12:17 AM
Aug 15, 2013 at 12:17 AM
some confusion in my mind. same number has two names. besides the dellimiters in the data sheet is not clear. upload your file to
speedyshare.com
and copy the address for downloading
before that try to give two examle results in the data sheeset and then upload.explain again if necessary
speedyshare.com
and copy the address for downloading
before that try to give two examle results in the data sheeset and then upload.explain again if necessary
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 17, 2013 at 01:55 AM
Aug 17, 2013 at 01:55 AM
see T2 which is concatenate formula A2 and B2
T2 is copied down till data is there (row no. 76)
the result of the macro is U,V,W so that you can check your manual calculations in Q R S.
confirm this will do
the modified macro is called
lounnacTotals
donwload the file from web address
http://speedy.sh/ufMEp/lounnac-CreateMacro-130807.xlsm
open and enable macros.
the macro is module and also repeated here
T2 is copied down till data is there (row no. 76)
the result of the macro is U,V,W so that you can check your manual calculations in Q R S.
confirm this will do
the modified macro is called
lounnacTotals
donwload the file from web address
http://speedy.sh/ufMEp/lounnac-CreateMacro-130807.xlsm
open and enable macros.
the macro is module and also repeated here
Sub lounnacTotals() 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 Application.ScreenUpdating = False Worksheets("sheet1").Activate Range("U1:W1").EntireColumn.Delete Set r1 = Range(Range("T1"), Range("T1").End(xlDown)) Set r = Range("A1").CurrentRegion r.Sort Key1:=Range("B1"), Header:=xlYes Set filt = Range("A1").End(xlDown).Offset(15, 0) r1.AdvancedFilter xlFilterCopy, , filt, True Set filt = Range(filt.Offset(1, 0), filt.End(xlDown)) For Each cfilt In filt r.AutoFilter field:=Range("T1").Column, Criteria1:=cfilt ssum = WorksheetFunction.Sum(r.Columns("N:N").SpecialCells(xlCellTypeVisible)) j = Range("c1").End(xlDown).Row Cells(j, "O") = ssum Cells(j, "U") = WorksheetFunction.CountA(Columns("M:M").SpecialCells(xlCellTypeVisible)) - 1 Cells(j, "V") = WorksheetFunction.CountA(Columns("B:B").SpecialCells(xlCellTypeVisible)) - 1 Cells(j, "W") = Cells(j, "U") / Cells(j, "V") ActiveSheet.AutoFilterMode = False 'ssum = 0 'Columns("O:O").Select 'Selection.Style = "Currency" Next cfilt Columns("O:O").Cells.NumberFormat = "$#,##0.00" Columns("W:W").Cells.NumberFormat = "0.00%" Range("U1:W1").EntireColumn.AutoFit Range(Range("A1").End(xlDown).Offset(15, 0), Cells(Rows.Count, "A")).EntireRow.Delete Application.ScreenUpdating = True MsgBox "macro over" End Sub
louannc
Posts
7
Registration date
Tuesday August 6, 2013
Status
Member
Last seen
August 21, 2013
Aug 19, 2013 at 03:32 PM
Aug 19, 2013 at 03:32 PM
Thank you for all your hard work. We are so close to what I need; however, I wanted the macro to do the manual calculations I did in Columns Q, R & S, and leave the result as the formula. If column Q remains as a 'countif' function, the M column can change as I add "x' to denote a receipt turned in, and Q will reflect those changes and return a different percentage in S (which has the function of Q/R) as it changes. The purpose is to do a continual count of the number of receipts submitted in column M.. Does that make sense? I adapted your macro to make the computations in the Q, R, S columns, but it is returning the value, and I need it to remain as the functions (Q as a countif function, R as =rows function, and S as percentage (Q/R)). I so truly appreciate all your help.
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 19, 2013 at 11:53 PM
Aug 19, 2013 at 11:53 PM
does it mean you DO NOT WANT A MACRO but only formulas so tht automaticalll reslts will change????
louannc
Posts
7
Registration date
Tuesday August 6, 2013
Status
Member
Last seen
August 21, 2013
Aug 20, 2013 at 02:39 PM
Aug 20, 2013 at 02:39 PM
I want the macro itself to auto-perform the functions for each cardholder, and leave the results as the function, not the value. Are you saying a macro cannot be created to perform those functions? That was my fear. I have over 300 cardholders with charges each month, and to go down and manually sum each one, then do the countif function, rows function, and percentage calculation for each one is very time consuming. Your macro gave me the results I wanted, but did not allow for changes as additional 'x's were placed in the receipt column.
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 20, 2013 at 09:41 PM
Aug 20, 2013 at 09:41 PM
every montgh you can run the macro
whenever ou run the macro the columns U to W are deleted and even if some more rows of data are added I am sure that the macro will take care off. you need not do anything manuall except to click "srun" the macro.
try this:
1.run the macro
2. now add some ficitious data at two or three rows after the end of current rowa. .;
3. now run te macro
4. see whether you get what ou want
5. still if there is probolem revert back to newsgsroup explaining clarly what the problem, is.
whenever ou run the macro the columns U to W are deleted and even if some more rows of data are added I am sure that the macro will take care off. you need not do anything manuall except to click "srun" the macro.
try this:
1.run the macro
2. now add some ficitious data at two or three rows after the end of current rowa. .;
3. now run te macro
4. see whether you get what ou want
5. still if there is probolem revert back to newsgsroup explaining clarly what the problem, is.
louannc
Posts
7
Registration date
Tuesday August 6, 2013
Status
Member
Last seen
August 21, 2013
Aug 21, 2013 at 09:59 AM
Aug 21, 2013 at 09:59 AM
Thank you. Sorry I couldn't explain clearly enough what I needed. Your efforts were appreciated.
Aug 16, 2013 at 08:37 AM