Matthew has attended:
Project Management - Framework & Processes course
Excel Intermediate course
Excel Advanced course
Excel VBA Introduction course
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