473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to create a checkbox subgroup in excel 2007?

I have a list of level 1 checkboxes and I want to add a level 2 set of checkboxes to some of them, but I only want them to show when level 1 is checked. For example, if I check the box marked "fish", I want three more boxes to appear below it that I can also check for types of fish. Below is the coding I was advised to use, but it's not working, when I click the fish box nothing happens. I'm not very familiar with VB but I have about 25 different categories I want to add multiple second level checkboxes to. Can you help me with what I'm doing wrong? Thank you!

Code:

Sub CheckBox1_Click()

End Sub

Private Sub Fish_Click()
Range("A5").EntireRow.Hidden = Not (OLEObjects("Fish").Object)
End Sub
Nov 2 '10 #1
1 3916
maxamis4
295 Expert 100+
You would have to use events. When you check you will need to reload the macros. So on check (in access you use me.reload) there needs to be a method where it reloads which will make the boxes appear or disappear.

Expand|Select|Wrap|Line Numbers
  1. Private Sub CheckBox2_Click()
  2.     Application.ScreenUpdating = False
  3.     With Sheet2.CheckBox2
  4.       If .Value = True Then
  5.           Rows("30:59").EntireRow.Hidden = False
  6.       Else
  7.           Rows("30:59").EntireRow.Hidden = True
  8.       End If
  9.    End With
  10.  
  11. Sheet2.Range("A1").Select
  12. End Sub
  13.  
  14.  
See this code I found seems to refresh data.
Nov 20 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: silverear | last post by:
Hello everybody, I have written an application that is running as an Office project within Excel in C#. I created a setup project for my tool. When I install my program on a machine that has...
1
by: =?Utf-8?B?RGVicmEgTGFzc21hbg==?= | last post by:
I have installed Office 2007 on my machine and when I open Excel 2007 I still have 256 columns and 65,536 rows. I know in the 2007 version that you have the ability to have more than this. If I add...
2
by: =?Utf-8?B?RHVrZSBDYXJleQ==?= | last post by:
I *did* have Excel 2003 on my office PC and was fiddling with a little VB Express app that interacted with Excel - nothing complex, but it worked. Since then IT has upgraded me to Office 2007 and...
15
by: =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= | last post by:
Hi All, We are in the process of Upgrade Excel 2003 (Office 2003) to Excel 2007 (Office 2007) for one of web application. This web application is using Excel (Pivot Table) reports. With Excel...
0
by: Spectur | last post by:
I am working with VB.net 2005 and VSTO 2005 se to create an add-in for Excel 2007. The issue I am having is I have query files that are used by my addin that need to reside with the Excel workbook...
0
by: arindams | last post by:
I'm getting problem in pasting HTML text in Excel 2007 whereas it is working fine in Excel 2003. The data pasted in excel 2007 is showing the the HTML code which is not desired. I need to have the...
0
by: mortonc | last post by:
I am trying to build a datacube using Excel 2007 and SQL Server 2000. I need it so I can connect the database into SharePoint 2007. Does anyone know how to create a datacube?
9
by: AGP | last post by:
I have a VB6 application that has an OLE container with an embedded Excel chart. Our office updated to Excel 2007 and now although the app works the charts looks like crap. Since the app is fairly...
1
by: Ally | last post by:
Hi all, I’m looking to plot charts in Excel from python. After some Googling I’ve found the following code: def plot(x, y, xAxisLog=False, yAxisLog=False): # acquire application object, which...
1
newnewbie
by: newnewbie | last post by:
Hi, Short version: trying to export more than 65K of data from Access 2007 into Excel 2007 (important) through VBA. Access gives me 65K row limitation error, though I thought that was no longer...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.