Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

macros

ResolvedVersion 2010

Macros

Hi

I have successfully recorded a macro that looks at a column and determines if it is blank. It then sorts the column so the blank cells disappear by de-selecting the TRUE box. I have then hidden the column with the ISBLANK function.

I am having a few problems now.

Firstly I have to be in a specific cell to start with for the macro to work correctly. I want it set up so that i can just be on the active sheet and then the macro will work.

The reason for this is that every month a new sheet will be added so eventually there will be 12 sheets. I want to just click on the new month and apply the macro to hide all empty rows.

Hope you can help

Many thanks

Matthew

RE: Macros

Hi Matthew,

Thank you for the forum question.

If you only use the macro recorder you have some limitations. When you record a macro Excel will do exactly what you have recorded.

To help you I will need to see the code or even better the Excel workbook.

Do you want to hide blank rows or blank columns?

Or do you want to delete them?

If you want to delete blank rows and columns you can use the code below. If you have the headings in row 1 please amend Rows(5) to Rows(1). If your first column with data is C please change Columns(1) to Columns(3):

Sub DeleteBlankRowsAndColumns()
Rows(5).SpecialCells(xlCellTypeBlanks).EntireColumn.Delete

Columns(1).SpecialCells(xlCellTypeBlanks).EntireRow.Delete


End Sub

If you want me to have a look at your code please copy it and paste it here.

If you want me to have a look at the workbook please forward it to:

info@stl-training.co.uk





Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

 

Training courses

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

New to Excel 2010 - Sparklines!

Excel 2010 includes a new feature called Sparklines which are tiny charts that fit into a single cell and plot data in cells from the worksheet. There are a host of formatting and styles that can be applied to them and they are really quite interesting.

>insert
>sparklines
>Choose any style you want

You will be asked for the range and it will automatically select the cell your in to insert the sparklines.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.