Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default macro and deleting or hiding columns

Hello
I have done very basic macros using "tools" and "record new macro". I need
to create one that will delete some columns and hide others. How can I do
this please?
Many thanks. I am working on excel 2003.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default macro and deleting or hiding columns


Columns("H:J").Delete
Columns("M:O").Hidden = True

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Pascale" wrote in message
...
Hello
I have done very basic macros using "tools" and "record new macro". I need
to create one that will delete some columns and hide others. How can I do
this please?
Many thanks. I am working on excel 2003.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default macro and deleting or hiding columns

Brilliant It works! However, I want to be able to use this macro with all my
spreadsheets, can you please tell me how to not have this macro attached to a
specific spreadsheet but be accessible to all spreadsheets opened or not?
thanks. Pascale

"Bob Phillips" wrote:


Columns("H:J").Delete
Columns("M:O").Hidden = True

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Pascale" wrote in message
...
Hello
I have done very basic macros using "tools" and "record new macro". I need
to create one that will delete some columns and hide others. How can I do
this please?
Many thanks. I am working on excel 2003.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default macro and deleting or hiding columns

Do you mean sheets (within a workbook), or all workbooks in a folder?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Pascale" wrote in message
...
Brilliant It works! However, I want to be able to use this macro with all
my
spreadsheets, can you please tell me how to not have this macro attached
to a
specific spreadsheet but be accessible to all spreadsheets opened or not?
thanks. Pascale

"Bob Phillips" wrote:


Columns("H:J").Delete
Columns("M:O").Hidden = True

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Pascale" wrote in message
...
Hello
I have done very basic macros using "tools" and "record new macro". I
need
to create one that will delete some columns and hide others. How can I
do
this please?
Many thanks. I am working on excel 2003.






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default macro and deleting or hiding columns

Would you like to delete/hide any particular rows/columns? What is your
criteria for deleting/hiding?

The macro below will delete all blank rows in a selected range, is that any
good?

Sub Deleteblankrows()
Dim Rw As Range
If WorksheetFunction.CountA(Selection) = 0 Then
MsgBox "You didn't select a range", vbOKOnly
Exit Sub
End If
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
Selection.SpecialCells(xlCellTypeBlanks).Select
For Each Rw In Selection.Rows
If WorksheetFunction.CountA(Selection.EntireRow) = 0 Then
Selection.EntireRow.Delete
End If
Next Rw
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub

Mike

"Pascale" wrote:

Hello
I have done very basic macros using "tools" and "record new macro". I need
to create one that will delete some columns and hide others. How can I do
this please?
Many thanks. I am working on excel 2003.



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
Combining Text from 2 Columns into 1 then Deleting the 2 Columns sleepindogg Excel Worksheet Functions 5 September 19th 08 12:36 AM
Hiding columns without usimg a macro Mick Excel Worksheet Functions 3 January 30th 07 09:53 PM
hiding columns [email protected] Excel Discussion (Misc queries) 3 July 12th 06 04:42 PM
Hiding Columns belony Excel Discussion (Misc queries) 4 June 15th 05 12:27 AM
Hiding columns Adam Excel Discussion (Misc queries) 2 March 31st 05 05:07 PM


All times are GMT +1. The time now is 05:27 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"