Results 1 to 10 of 10

check checkbox value by position

Threaded View

  1. #1
    Registered User
    Join Date
    05-21-2010
    Location
    Berlin
    MS-Off Ver
    Excel 2003 SP3
    Posts
    19

    check checkbox value by position

    Good Morning folks I am looking for a way to check if a position that I can aquire by code (e.g .Cells(x,y)) contains a checkbox and what value (e.g 0 or 1) that checkbox has.
    The reason for this is that I want to automatically create an overview about data in different sheets, ordered by the content of a certain cell as well as by the state of several checkboxes each row.
    The following code is what I came up with concerning the testing of the cell content. Now the row of each cell checked this way also contains a checkbox at .Cells(ICountRow, 2) .Cells(ICountRow, 5) and .Cells(ICountRow, 6). But I don not how how to acces the value of the checkbox therein. The checkboxes used by me are from the Forms toolbar.

    Sub Process_Overview()
    
        Dim ICountRow As Integer
        Dim ICounttest1 As Integer
        Dim ICounttest2 As Integer
        Dim ICounttest3 As Integer
        Dim ICounttest4 As Integer
        Dim ICounttest5 As Integer
    
        LName = Application.Caller
    
        ICounttest1 = 0
        ICounttest2 = 0
        ICounttest3 = 0
        ICounttest4 = 0
        ICounttest5 = 0
    
    If ActiveSheet.DrawingObjects(LName).Value > 0 Then
        ActiveSheet.DrawingObjects(LName).Value = 0
    End If
    
    For ICountRow = 15 To 300 Step 1
    
            If Worksheets(3).Cells(ICountRow, 17).Value = "test1" Then
                ICountUhde = ICounttest1 + 1
            ElseIf Worksheets(3).Cells(ICountRow, 17).Value = "test2" Then
                ICountHeraeus = ICounttest2 + 1
            ElseIf Worksheets(3).Cells(ICountRow, 17).Value = "test3" Then
                ICountJohnson = ICounttest3 + 1
            ElseIf Worksheets(3).Cells(ICountRow, 17).Value = "test4" Then
                ICountYara = ICounttest4 + 1
            ElseIf Worksheets(3).Cells(ICountRow, 17).Value = "test5." Then
                ICountna = ICounttest5 + 1
            ElseIf Worksheets(3).Cells(ICountRow, 17).Value = "Test5" Then
                ICountna = ICounttest5 + 1
            End If
    
    Next ICountRow
    
    ActiveSheet.Cells(9, 4).Value = ICounttest1
    ActiveSheet.Cells(10, 4).Value = ICounttest2
    ActiveSheet.Cells(11, 4).Value = ICounttest3
    ActiveSheet.Cells(12, 4).Value = ICounttest4
    ActiveSheet.Cells(13, 4).Value = ICounttest5
    
    End Sub

    -----
    Sincerely yours John

    PS I already posted the question in an Excel newsgroup but sadly haven't been answered.
    Last edited by grendel_42; 05-21-2010 at 09:08 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1