Delete columns simultaneously in several different workbooks

  • Thread starter gjalt.lindeboom
  • Start date
G

gjalt.lindeboom

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
 
R

raypayette

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
 
Top