button hideshow rows
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Button to hide/show rows

Button to hide/show rows

resolvedResolved · Low Priority · Version 2007

replyReplyTue 4 May 2010, 16:03Delegate Tom said...

Button to hide/show rows

Hi,

I am looking to create a button that hides certain rows at the first click and then shows them again on the next click, I thought this would do it (partly taken from a recorded macro) but it only hides the rows and then does nothing. Thanks very much...


Sub Hide_Previous_Working_Week()

' Hides the previous working week table

If Rows("30:53").Hidden Then

Rows("30:53").Select
Selection.EntireRow.Hidden = False

Else
Rows("31:52").Select
Selection.EntireRow.Hidden = True

End If

End Sub

For upcoming training course dates see: Pricing & availability

replyReplyWed 5 May 2010, 17:16Trainer Stephen said...

RE: Button to hide/show rows

Hi Tom

Thanks for your question

Your problem was that when the rows were hidden, you were trying to select them, and this was causing problems. Fortunately, this is not necessary.

I have rewritten the code thus:

Sub Hide_Previous_Working_Week()

' Hides the previous working week table

If Rows("30:53").Hidden Then


Rows("30:53").EntireRow.Hidden = False

Else

Rows("30:53").EntireRow.Hidden = True

End If

End Sub


and it now works

Regards


Stephen

replyReplyThu 6 May 2010, 09:44Delegate Tom said...

RE: Button to hide/show rows

Thats brilliant thank you very much for your time.

Tom

 

 

Please browse our web site to find out more about
exce+training and other Microsoft training courses.

Excel tip:

Adding Rows or Columns in an Excel 2010 Worksheet

If you want to add a row to an Excel spreadsheet, these are the simple steps you should take:

With your mouse, right click on the row header below where you want the new row to be added. Then, click Insert.

Follow exactly the same steps if you want to add a column to an Excel worksheet, right click on the column header, choose Insert and the new column will be inserted to the left of the selected column.

View all Excel hints and tips

forum postIf you have moved the centre of rotation of an object so that it can't be seen any longer and you can't 'grab' it, see it or find it (ie onto one of the resizing handles for example)... is there a quick way of resetting the centre of rotation back to the ..

» Forum post: Visio - Centre of Rotation - Resetting


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training