Help with VBA

saroo970

New Member
Joined
Oct 4, 2021
Messages
17
Office Version
  1. 2019
Platform
  1. Windows
I have 100 excel sheets all of them are identical with seven columns (Date, Open, High, Low, Close, Adj Close, Volume) what I need is to

1- delete all the columns in all 100 excel sheets inside the folder but keep only two columns (“Date”, and the “Close”)
2- I need to format all the 100 sheets the first column “Date” columns to be (dd-mmm-yyyy) and the “close” columns to be in this format 0.00000 which means the number should be like this 5.12345.

Thanks,
Sam
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
If my script does not work and you are referring to sheets in a certain folder we would need a lot more details like workbook name. The path to the folder and maybe more. Let me know if this script does not work. My script runs in the Open workbook. And performs the script in all the sheets in the current workbook
 
Upvote 0
the folder contains 100 workbooks not sheets, i have already mentioned that (post #5) I need to delete these columns in all the Workbooks, not in sheets (i am not an Excel guru forgive me). and the formating should come after the deletion.
 
Upvote 0
the folder contains 100 workbooks not sheets, i have already mentioned that (post #5) I need to delete these columns in all the Workbooks, not in sheets (i am not an Excel guru forgive me). and the formating should come after the deletion.
I will not be able to help you with this. It is beyond my knowledgebase.
But I believe you would have to provide more details like the path to the folder and the Workbook names and maybe more. Maybe someone else here will be able to help you.
 
Upvote 0
already provided the path to the folder. Thanks to you anyway.
 
Upvote 0
this is my folder and what it contains (Workbooks).
 

Attachments

  • Capture.PNG
    Capture.PNG
    32.5 KB · Views: 5
  • Capture1.PNG
    Capture1.PNG
    23.2 KB · Views: 5
Upvote 0
I will continue to monitor this posting to see what I can learn.
The script would look something like this for each Workbook in folder "Alpha" for each sheets in active workbook do this.
Each workbook would have to be opened then the script would run close that workbook and go to the next workbook.
I'm sure someone like Fluff will be able to help you.
 
Upvote 0
Yes, definitely true. I hope someone can help. it can be done manually but as you can see it is very hard to do one by one. Appreciate your input and trying to help
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

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