LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Kim Kim is offline
external usenet poster
 
Posts: 284
Default Macro to delete Column

Hi all,

I tried to record a macro to delete some column. Here is what I got but when
I run the macro it didn't performe correctly:

Sub Selection()

Sheets("Negotiation Tool Report").Select
Sheets("Negotiation Tool Report").Copy After:=Sheets(1)
Sheets("Negotiation Tool Report (2)").Select
Sheets("Negotiation Tool Report (2)").Name = "Selection"
Columns("A:A").Select
ActiveCell.Delete Shift:=xlToLeft
Columns("M:Z").Select
Selection.Delete Shift:=xlToLeft
Sheets.Add After:=Sheets(Sheets.Count)

When I run it keep come out as error on Selection.Delete. I've tried
changing Selection to ActiveCell but the result is that it select the cell
but didn't delete them.

Can anyone help?

Thanks.
Kim
 
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
Copy column header to next column, delete & delete every nth colum genehunter New Users to Excel 1 June 2nd 09 03:57 PM
Macro to Delete first words in a column Jeff[_4_] Excel Discussion (Misc queries) 12 October 19th 07 10:33 PM
macro to delete the last value in each column z.entropic Excel Worksheet Functions 11 July 21st 07 01:10 PM
Delete a Column when in a Macro-Worksheet Event? jeannie v Excel Worksheet Functions 2 July 19th 07 01:58 AM
set up a macro to delete characters in each cell of a column Rick Excel Discussion (Misc queries) 2 September 18th 05 03:02 AM


All times are GMT +1. The time now is 09:53 PM.

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

About Us

"It's about Microsoft Excel"