Macro Help please

knowexcel

New Member
Joined
Jul 20, 2011
Messages
4
I have few workbooks in a folder. I would like to rename each sheet, resize image and modify text style in particular cell in all workbooks in the folder. Could some one please let me know how to do it?

Thanks
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Ok give us a clue.

Is this to be done in each workbook in a folder or specific workbooks if so please supply the names.

Which sheets are to be renamed (From what, to what), which sheet as the image, does it have a name. which cell do you want to format and what is the format you want.
 
Upvote 0
Thanks for the reply. It has to be done in all workbooks in a folder. Each work book has 3 sheets, i want to rename all sheets. Image should be same size on all sheets, image has a name. I want to display data in one cell vertically on each sheet.

Thanks
 
Upvote 0
Here is some code that will loop through all workbooks in a folder and make a change, you can adapt it as necessary.


Sub Open_My_Files()
Dim MyFile As String
MyPath = "M:\Access Files\"
MyFile = Dir(MyPath)
Do While MyFile <> ""
If MyFile Like "*.xls" Then
Workbooks.Open MyPath & MyFile
Sheets(1).Select 'Add code here to rename each sheet, you can record a macro to give you the code then add it here.
Range("C3") = 6 'Alter the cell id to change the format, again you can record a macro to do this and copy the code here.
ActiveWorkbook.Close True
End If
MyFile = Dir
Loop
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

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