Vba

hoopslogan

Board Regular
Joined
Jun 21, 2016
Messages
94
Hello,

I am trying to write a macro that does the following:
1. Takes the Info located on Sheet 1 in the Range A5:Last Row in Column C and pastes these labels into a new sheet starting in cell A1 . After this is done, the macro needs to paste two more headings 1 in D1 of the new sheet titled Mean and 1 in E1 titled Std. Deviation.
2. Next I need the macro to loop through each Row value on Sheet 1 and calculate the corressponding mean and Std. Deviation for each Value 1 and Value 2 category per Business Level.

Here is some sample sheets. The first one is the input Sheet 1 where the data is being pulled from and the Second is what i want my output to look like.

Business Level 1Business Level 2CategoriesNov 2015Dec 2015Jan 2016Feb 2016Mar 2016Apr 2016May 2016
TruckingField 1Value 10.0182922820.0172157880.0185550.0186250.0211630.0220680.020451
Value 20.0194973530.0177744070.0179960.017650.0158780.0161060.017905
Field 2Value 10.0111036150.0129558580.0119380.0135270.018170.018160.018428
Value 20.0429064730.0397136420.0392970.038890.0386970.03830.037
Field 3Value 10.0194418910.020949070.0199040.0201090.0300640.0297340.030599
Value 20.0412241260.0376618680.0378130.0379240.0372450.0368250.035153
Field 4Value 10.0027575270.0028086450.0029590.0035350.0036960.0037410.003956
Value 20.0297841660.0275523180.0279260.0275920.0278550.0278570.028447
Trucking Value 1 Total0.0128174030.0136886910.0132440.0139830.0186670.0186730.018678
Trucking Value 2 Total0.1334121180.1227022350.1230320.1220560.1196760.1190870.118504
CyclingField 5Value 10.0131605980.0114253480.0115460.0114210.0112730.0104640.010359
Value 20.0077527110.0067280320.0065370.0066870.0066520.0067730.006766
Field 6Value 10.012138920.0117997740.0121590.0123130.0124430.0092210.008852
Value 20.0226465020.0215479520.0216130.0203040.0197320.0185540.018263
Field 7Value 10.012277980.0122462150.0109120.0115480.0120840.0127560.01279
Value 20.0567526230.0544706640.0542010.0480610.0465630.0460870.046196
Cycling Value 1 Total0.0123201490.0120631520.011290.0117440.0121070.0116190.011547
Cycling Value 2 Total0.0871518350.0827466480.0823510.0750520.0729470.0714140.071225
InstrumentalField 8Value 10.0059733220.0065232780.0065470.0048080.0071780.0069230.007086
Value 20.0081961460.006914880.0069170.0106870.0056040.0057130.004776
Field 9Value 10.002416940.0026339870.0026190.0026330.0025270.0025740.002611
Value 20.3426659650.3296736430.329870.3264510.3464560.3494430.346403
Instrumental Value 1 Total0.0024998210.0027136870.0026990.0027010.0026010.0026430.002671
Instrumental Value 2 Total0.350862110.3365885230.3367860.3371380.3520610.3551560.351179
MagneticField 10Value 10.0046583670.0048999630.0046960.0046350.006090.0058710.005631
Value 20.0364381360.0306810780.0315370.0329210.0252660.0262590.027404
Magnetic Value 1 Total0.0046583670.0048999630.0046960.0046350.006090.0058710.005631
Magnetic Value 2 Total0.0364381360.0306810780.0315370.0329210.0252660.0262590.027404
ManufacturersField 11Value 10.0152299360.0170910970.0169230.0164540.0172430.006610.006515
Value 20.0015749010.0011020710.0012850.0012580.0012890.0013330.001275
Field 12Value 10.0078310960.0089368530.0091510.0100520.011170.0113910.011495
Value 20.0529198650.0645966740.0624880.0608380.0577350.0576650.059187
Field 13Value 10.0106539710.0104463210.0103040.0103940.0106830.0104010.010365
Value 20.0561551120.0525522260.0548650.0544140.0553440.0562080.057572
Field 14Value 10.0109725930.0097410.0098820.0099370.0089940.0090780.007514
Value 20.0428070530.0469593940.0470.0462410.0458350.0452420.045338
Manufacturers Value 1 Total0.0098147440.0096981410.0097990.0101820.0104280.0103550.009957
Manufacturers Value 2 Total0.1534569310.1652103650.1656370.1627510.1602030.1604480.163373
UnknownField 15Value 10.0073105430.0065853570.0060660.0058590.0056850.0055430.005521
Value 20.0056416020.005044010.0049310.004870.0047580.0048760.004774
Field 16Value 10.0116957110.0110392220.0133750.0083410.0088170.008780.008646
Value 20.0170176250.0083130260.0137280.0225580.0228550.0218090.022175
Unkown Value 1 Total0.0105777680.0093078650.0114130.0078950.0082740.0081820.008087
Unknown Value 2 Total0.0226592270.0133570350.018660.0274270.0276130.0266860.026949
BoatingField 17Value 10.015087240.0149753860.0143570.0143140.0138670.0136020.012971
Value 20.0719232870.0684549250.0689090.06870.0690920.06830.068696
Boating Value 1 Total0.015087240.0149753860.0143570.0143140.0138670.0136020.012971
Boating Value 2 Total0.0719232870.0684549250.0689090.06870.0690920.06830.068696
EnvironmentalField 18Value 10.0118043960.0131773690.0126240.0127560.0130250.0116560.011556
Value 20.0140387570.0143275950.0146080.0144690.0144030.0153220.015719
Field 19Value 10.0151776550.0158646530.0162090.015240.0156170.0152540.015183
Value 20.0099897370.0097252310.0092470.0090770.0088850.0090090.008559
Field 20Value 10.0134322950.0121385140.0120960.0123750.012750.0123750.012283
Value 20.0053968490.0050931190.0050530.0051130.0051210.0050010.005045
Field 21Value 10.0092175580.0091306460.009250.0094810.00920.0093860.009504
Value 20.0375046410.0371256920.0388610.039170.0393340.0389890.039066
Field 22Value 10.0088363230.0089368380.0090810.008310.0086480.0083560.008683
Value 20.0144068360.013654620.0136710.0148690.014670.0148460.014859
Field 23Value 10.0092786470.0112868240.0106340.0099350.0100210.0097880.009714
Value 20.0273399280.0293084580.0271020.0268710.0264630.0252610.025393
Field 24Value 10.0117417240.011685830.0113960.0112660.0110820.0110120.010881
Value 20.0127758940.0119863240.0117960.0119930.0120410.0116960.011726
Field 25Value 10.007484270.0164323210.0143280.0141290.0145070.0153950.01524
Value 20.0226437140.0590381520.0527510.0523910.0522250.0525270.052302
Environmental Value 1 Total0.0099552920.0127818390.0118750.0116180.0117520.0118760.011832
Environmental Value 2 Total0.1440963560.180259190.1730890.1739550.1731420.1726510.172669
Total Value 10.0080784170.0087827870.0084820.0085140.0090460.0089740.00888
Total Value 21111111

<COLGROUP><COL style="WIDTH: 237pt; mso-width-source: userset; mso-width-alt: 11556" width=316><COL style="WIDTH: 215pt; mso-width-source: userset; mso-width-alt: 10459" width=286><COL style="WIDTH: 55pt; mso-width-source: userset; mso-width-alt: 2669" width=73><COL style="WIDTH: 63pt; mso-width-source: userset; mso-width-alt: 3072" width=84><COL style="WIDTH: 66pt; mso-width-source: userset; mso-width-alt: 3218" width=88><COL style="WIDTH: 48pt" span=5 width=64><TBODY>
</TBODY>

Business Level 1Business Level 2CategoriesMeanStd. Dev
TruckingField 1Value 1
Value 2
Field 2Value 1
Value 2
Field 3Value 1
Value 2
Field 4Value 1
Value 2
Trucking Value 1 Total
Trucking Value 2 Total
CyclingField 5Value 1
Value 2
Field 6Value 1
Value 2
Field 7Value 1
Value 2
Cycling Value 1 Total
Cycling Value 2 Total
InstrumentalField 8Value 1
Value 2
Field 9Value 1
Value 2
Instrumental Value 1 Total
Instrumental Value 2 Total
MagneticField 10Value 1
Value 2
Magnetic Value 1 Total
Magnetic Value 2 Total
ManufacturersField 11Value 1
Value 2
Field 12Value 1
Value 2
Field 13Value 1
Value 2
Field 14Value 1
Value 2
Manufacturers Value 1 Total
Manufacturers Value 2 Total
UnknownField 15Value 1
Value 2
Field 16Value 1
Value 2
Unkown Value 1 Total
Unknown Value 2 Total
BoatingField 17Value 1
Value 2
Boating Value 1 Total
Boating Value 2 Total
EnvironmentalField 18Value 1
Value 2
Field 19Value 1
Value 2
Field 20Value 1
Value 2
Field 21Value 1
Value 2
Field 22Value 1
Value 2
Field 23Value 1
Value 2
Field 24Value 1
Value 2
Field 25Value 1
Value 2
Environmental Value 1 Total
Environmental Value 2 Total
Total Value 1

<COLGROUP><COL style="WIDTH: 139pt; mso-width-source: userset; mso-width-alt: 6765" width=185><COL style="WIDTH: 81pt; mso-width-source: userset; mso-width-alt: 3949" width=108><COL style="WIDTH: 55pt; mso-width-source: userset; mso-width-alt: 2669" width=73><COL style="WIDTH: 48pt" width=64><COL style="WIDTH: 55pt; mso-width-source: userset; mso-width-alt: 2669" width=73><TBODY>
</TBODY>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,216,750
Messages
6,132,502
Members
449,730
Latest member
SeanHT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top