ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Delete columns simultaneously in several different workbooks (https://www.excelbanter.com/excel-discussion-misc-queries/104014-delete-columns-simultaneously-several-different-workbooks.html)

[email protected]

Delete columns simultaneously in several different workbooks
 
Hi!

Hope somebody has a bood tip for me on this problem, thanx in advance!

If I want to delete several columns in all the workbooks which are in
one folder, is there a quick solution to this? For example: Folder A
has a 100 Excel (2003) workbooks, and in all of those I want to delete
columns J through P. Should that be done manually or is there a trick?

Thanx!

Gjalt


raypayette

Delete columns simultaneously in several different workbooks
 

This is not a trick, simply a specific routine VBA was designed to do:

For i = 1 To 100
Workbooks.Open Filename:="C:\Excel\Book" & i & ".xls"
Sheets("Sheet1").Select
Columns("C:P").Select
Selection.Delete Shift:=xlToLeft
Workbooks.Close
Next

It should be adapted to your specifications.


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=569899



All times are GMT +1. The time now is 08:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com