Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
sh sh is offline
external usenet poster
 
Posts: 8
Default CONDITIONAL DELETE

WE EXPORT STUFF FROM ACCOUNTS PROGRAM TO EXCEL AND THERE ARE A LOT OF COLUMNS THAT HAVE NO DATA. IS IT POSSIBLE TO DELETE ALL SUCH COLUMNS IN ONE STROKE THROUGH PROGRAMMING. IF SO, KINDLY LET ME KNOW.

ALSO, THERE USED TO BE AN EDIT DELETE COMMAND IN EXCEL. NOW THERE IS AN EDIT DELETE ROW COMMAND. I CAN'T FIND THE NORMAL COMMAND ANYWHERE. PLEASE GUIDE. THANK YOU.
--
LEARNING MS OFFICE THOROUGHLLY
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default CONDITIONAL DELETE

Hi SH,

For your information, your type of block upper case uasge is regarded as
impolite shouting. That aside, it is disconcerting and unpleasant.

To delete your blank columns, try:

Sub DeleteBlankCols()
Dim WB As Workbook
Dim WS As Worksheet
Dim iCol As Long
Dim CalcMode As Long

With Application
CalcMode = .Calculation
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With

Set WB = ActiveWorkbook '<<<<<<<<<<<<<CHANGE TO SUIT
Set WS = ActiveSheet '<<<<<<<<<<<<<CHANGE TO SUIT

For iCol = WS.UsedRange.Columns.Count To 1 Step -1
If Application.CountA(Columns(iCol).Cells) = 0 Then
Columns(iCol).Delete
End If
Next
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub


---
Regards,
Norman



"SH" wrote in message
...
WE EXPORT STUFF FROM ACCOUNTS PROGRAM TO EXCEL AND THERE ARE A LOT OF

COLUMNS THAT HAVE NO DATA. IS IT POSSIBLE TO DELETE ALL SUCH COLUMNS IN ONE
STROKE THROUGH PROGRAMMING. IF SO, KINDLY LET ME KNOW.

ALSO, THERE USED TO BE AN EDIT DELETE COMMAND IN EXCEL. NOW THERE IS AN

EDIT DELETE ROW COMMAND. I CAN'T FIND THE NORMAL COMMAND ANYWHERE. PLEASE
GUIDE. THANK YOU.
--
LEARNING MS OFFICE THOROUGHLLY



  #3   Report Post  
Posted to microsoft.public.excel.programming
sh sh is offline
external usenet poster
 
Posts: 8
Default CONDITIONAL DELETE

Hi Norman,
Extremely sorry for replying so late. My apologies once again for the
Uppercase usage. I am not really Forum Savvy. Very nice of you to give a
whole program. I shall try and revert back ASAP. Sincere regrets once again.

Regards

Norman.

"Norman Jones" wrote:

Hi SH,

For your information, your type of block upper case uasge is regarded as
impolite shouting. That aside, it is disconcerting and unpleasant.

To delete your blank columns, try:

Sub DeleteBlankCols()
Dim WB As Workbook
Dim WS As Worksheet
Dim iCol As Long
Dim CalcMode As Long

With Application
CalcMode = .Calculation
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With

Set WB = ActiveWorkbook '<<<<<<<<<<<<<CHANGE TO SUIT
Set WS = ActiveSheet '<<<<<<<<<<<<<CHANGE TO SUIT

For iCol = WS.UsedRange.Columns.Count To 1 Step -1
If Application.CountA(Columns(iCol).Cells) = 0 Then
Columns(iCol).Delete
End If
Next
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub


---
Regards,
Norman



"SH" wrote in message
...
WE EXPORT STUFF FROM ACCOUNTS PROGRAM TO EXCEL AND THERE ARE A LOT OF

COLUMNS THAT HAVE NO DATA. IS IT POSSIBLE TO DELETE ALL SUCH COLUMNS IN ONE
STROKE THROUGH PROGRAMMING. IF SO, KINDLY LET ME KNOW.

ALSO, THERE USED TO BE AN EDIT DELETE COMMAND IN EXCEL. NOW THERE IS AN

EDIT DELETE ROW COMMAND. I CAN'T FIND THE NORMAL COMMAND ANYWHERE. PLEASE
GUIDE. THANK YOU.
--
LEARNING MS OFFICE THOROUGHLLY




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
Conditional Delete Statement chrisjack001 Excel Worksheet Functions 0 September 9th 10 08:36 PM
Conditional delete tom[_2_] Excel Discussion (Misc queries) 2 October 15th 09 10:44 PM
Conditional Delete [email protected] New Users to Excel 3 May 25th 07 03:25 AM
Conditional Row Select and Delete jagstirling[_5_] Excel Programming 3 September 30th 03 08:46 AM
Conditional row delete Penny[_3_] Excel Programming 1 July 30th 03 06:25 PM


All times are GMT +1. The time now is 10:33 AM.

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"