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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,956
Office Version
  1. 2013
Platform
  1. Windows
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
 

saroo970

New Member
Joined
Oct 4, 2021
Messages
17
Office Version
  1. 2019
Platform
  1. Windows
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.
 

saroo970

New Member
Joined
Oct 4, 2021
Messages
17
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

path to the folder C:\MyData
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,956
Office Version
  1. 2013
Platform
  1. Windows
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.
 

saroo970

New Member
Joined
Oct 4, 2021
Messages
17
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

already provided the path to the folder. Thanks to you anyway.
 

saroo970

New Member
Joined
Oct 4, 2021
Messages
17
Office Version
  1. 2019
Platform
  1. Windows
this is my folder and what it contains (Workbooks).
 

Attachments

  • Capture.PNG
    Capture.PNG
    32.5 KB · Views: 4
  • Capture1.PNG
    Capture1.PNG
    23.2 KB · Views: 4

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,956
Office Version
  1. 2013
Platform
  1. Windows
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.
 

saroo970

New Member
Joined
Oct 4, 2021
Messages
17
Office Version
  1. 2019
Platform
  1. Windows
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
 

Forum statistics

Threads
1,144,420
Messages
5,724,208
Members
422,542
Latest member
steve011

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
Top