Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a spreadhseet whose columns change each month. I want to automatically
delete all the columns in the spreadsheet ecept for the first and last columns. Is there a way to do this automatically? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub columnator()
Set r = ActiveSheet.UsedRange nLastColumn = r.Columns.Count + r.Column - 1 nFirstcolumn = r.Column For i = nLastColumn - 1 To nFirstcolumn + 1 Step -1 Columns(i).EntireColumn.Delete Next End Sub -- Gary's Student gsnu200712 "Kim Kautzmann" wrote: I have a spreadhseet whose columns change each month. I want to automatically delete all the columns in the spreadsheet ecept for the first and last columns. Is there a way to do this automatically? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks so much. This works perfectly.
"Gary''s Student" wrote: Sub columnator() Set r = ActiveSheet.UsedRange nLastColumn = r.Columns.Count + r.Column - 1 nFirstcolumn = r.Column For i = nLastColumn - 1 To nFirstcolumn + 1 Step -1 Columns(i).EntireColumn.Delete Next End Sub -- Gary's Student gsnu200712 "Kim Kautzmann" wrote: I have a spreadhseet whose columns change each month. I want to automatically delete all the columns in the spreadsheet ecept for the first and last columns. Is there a way to do this automatically? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
import Excel 2003 file into Outlook 2003 - NO NAMED RANGES?? | Excel Discussion (Misc queries) | |||
Copying Excel 2003 Selection into Outlook 2003 HTML E-Mail Message | Excel Discussion (Misc queries) | |||
Upgrade from Excel 2000 to Excel 2003 without MS Office 2003? | Excel Discussion (Misc queries) | |||
Exporting addresses from excel 2003 to outlook 2003 | Excel Discussion (Misc queries) | |||
Excel 2003 Database Driver Visual FoxPro 7 on Server 2003. | Excel Discussion (Misc queries) |