Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2015, 02:16 PM
gebobs gebobs is offline Hide rows with checkbox Windows 7 64bit Hide rows with checkbox Office 2010 64bit
Expert
Hide rows with checkbox
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default Hide rows with checkbox

OK...so I have a form with several rows that I would like to hide/show based on the value of a checkbox. There are some other checkboxes in this are that I want to hide with the rows that they are on. However, when I go to the Format Control: Properties, the Move and Size with cells option is grayed out. Any idea why that's happening?

Also, here is the macro...



Code:
Private Sub cbClaimHide_Click()
  If cbClaimHide = True Then
    [47:53].EntireRow.Hidden = True
    Else: [47:53].EntireRow.Hidden = False
  End If
End Sub
Regardless of whether it is checked or not, it always goes to else. What the heck have I screwed up?
Reply With Quote
  #2  
Old 03-24-2015, 05:05 AM
gebobs gebobs is offline Hide rows with checkbox Windows 7 64bit Hide rows with checkbox Office 2010 64bit
Expert
Hide rows with checkbox
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

I really need an answer to this so I am going to post elsewhere. If I find a solution, I will update this thread.
Reply With Quote
  #3  
Old 03-24-2015, 07:05 AM
gebobs gebobs is offline Hide rows with checkbox Windows 7 64bit Hide rows with checkbox Office 2010 64bit
Expert
Hide rows with checkbox
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

OK...so I figured out part of it. I was using a form control. I did the same with an ActiveX control and the hide/unhide worked swimmingly. Other than that, I really don't know what the difference is between the two types. Is there a way I can get this to work with the form control? Which type is better to use? Are there advantages of one over the other?
Reply With Quote
  #4  
Old 03-24-2015, 12:05 PM
Snakehips Snakehips is offline Hide rows with checkbox Windows 8 Hide rows with checkbox Office 2013
Advanced Beginner
 
Join Date: Mar 2015
Posts: 36
Snakehips is on a distinguished road
Default

gebobs,

ActiveX controls have arguably more properties that are readily set / read via the vba editor Properties pane and thus easy code.

Coding for form control properties is perhaps not so obvious but there are several ways you can refer to them.

One nice thing about using Form objects is that you can style and format them so much better than ActiveX

Try coding for your form checkbox as below.

Code:
Sub cbClaimHide_Click()
  If ActiveSheet.CheckBoxes("cbClaimHide").Value = 1 Then
    [47:53].EntireRow.Hidden = True
    Else: [47:53].EntireRow.Hidden = False
  End If
End Sub
Hope that helps.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide rows with checkbox Show/Hide Text based on Checkbox Selection tammytran105 Word VBA 7 10-02-2014 04:30 PM
Hide rows with checkbox Delete rows using checkbox in word deboer Word VBA 5 06-22-2014 05:21 AM
Hide rows with checkbox Hide Checkbox When Printing vinceplunkett Word 1 12-03-2013 01:53 AM
Hide Rows YounesB3 Excel 2 10-29-2012 05:40 AM
Hide rows with checkbox VBA for CheckBox to Hide Slides mutchy25 PowerPoint 1 09-21-2012 01:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft