VBA: Loop Analysis of Multiple Excel Workbooks

letonuslepus

New Member
Joined
Jun 3, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi, I'm trying to analyze many workbooks (formatted exactly the same) and place the analyzed data into a new master spreadsheet. How would I write a VBA macro to take an avg and stdev of a range of data for each workbook in a folder...they are labeled in the fashion "Myworkbook__00#" # being 1-20 and then deposit each avg and stdev into a new master sheet into respective ordered rows? I am struggling how to analyze the data in a loop as I am familiar with matlab not VBA macros. Attached is an example of the data I have. I am only needing to analyze the 3rd column of data

Thank you
 

Attachments

  • Capture.PNG
    Capture.PNG
    28.1 KB · Views: 10

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
try something like this:
VBA Code:
Sub test()
Lastrow = Cells(Rows.Count, "C").End(xlUp).Row
ave = WorksheetFunction.Average(Range("C2:C" & Lastrow))
std = WorksheetFunction.StDev(Range("C2:C" & Lastrow))
MsgBox "Average= " & ave & " Stdev= " & std

End Sub
I just realised this is only part of your question
 
Upvote 0

Forum statistics

Threads
1,223,931
Messages
6,175,465
Members
452,646
Latest member
tudou

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