Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Making a change in all worksheets

I am trying to delete a column in all worksheets. The code i'm using only
deletes the column in the first worksheet, but not the rest of them.

Dim sht As Worksheet
For Each sht In ThisWorkbook.Worksheets
Columns("D:D").Select
Selection.Delete Shift:=xlToLeft
Next sht

Any help would be greatly appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Making a change in all worksheets

Try this...

Dim sht As Worksheet
For Each sht In ThisWorkbook.Worksheets
sht.Columns("D:D").Delete Shift:=xlToLeft
Next sht

--
HTH...

Jim Thomlinson


"samlyon" wrote:

I am trying to delete a column in all worksheets. The code i'm using only
deletes the column in the first worksheet, but not the rest of them.

Dim sht As Worksheet
For Each sht In ThisWorkbook.Worksheets
Columns("D:D").Select
Selection.Delete Shift:=xlToLeft
Next sht

Any help would be greatly appreciated.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
making copied cells change with change in original cell Jennifer Mcdermeit Excel Worksheet Functions 2 July 20th 06 04:58 PM
Making changes to most worksheets? jonco Excel Programming 3 July 2nd 06 11:08 PM
Making worksheets Fabrizio Excel Programming 3 June 28th 06 01:29 PM
making new worksheets april27 Excel Programming 1 June 19th 06 04:00 PM
Programatically making worksheets dorre Excel Programming 1 February 5th 06 03:02 PM


All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"