macro breaking my head

mundofanny

New Member
Joined
May 21, 2011
Messages
6
Hi

after realizing that I needed a macro
and after realizing that it was just a bit messy for me I asking for help.

I have several folders.
In each folder I have about 25 spreadsheets with numerical data (nothing fancy). In each sheet there are many more columns and they vary with size.

what I was trying to do is

find the average of each column
copy and paste the average to the first cell of each column
and delete the rest.

says:

A1 ==4
A2 ==3
A3 ==2
A4 ==1


find: A5==average of A1:A4

special paste average to A1
delete values of A1:A5

continue to B

(number of column also varies)

do that for all the columns and if possible for all sheets (but I'll be just as happy with one sheet I could do the sheets manually unless you know :)

thanks fanny
 
I don't think I'm doing anything wrong but I keep having a warning on

With .Offset(-1).Resize(1)

there is nothing being computed.

thanks for the help.
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I'm not sure why you would get that error, but try replacing that line with this one
Code:
With Intersect(.EntireColumn, ws.Rows(1))
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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