counting html checkbox values (Excel 2010)

toshimarise

New Member
Joined
Feb 1, 2013
Messages
21
I am copying a large table of data from a report generated in Firefox and pasting it into Excel 2010. The data has several columns of html checkboxes. I need to do two things with the checkboxes and would like to do a third:

1: Count how many checkboxes are ticked in each of the columns.
2: Compare a column A of checkboxes to a column B containing numbers, and then both count and highlight any row where the checkbox is ticked but column B is a 0.
3: (optional) I would like to erase the html checkboxes and, if the box was checked, replace it with a regular x in the underlying cell.

I found some code on another forum that generates a list of values for each checkbox (vba - Obtain the value of an HTML Checkbox inserted in Excel worksheet - Stack Overflow).

Based on that, I recorded a macro to extract the htmlName of a single checkbox and then set up a Vlookup for the True/False value. However, I can't figure out how to automate a vlookup for every individual checkbox and put the data in the appropriate underlying cell.

There must be a more elegant way to do this.

Any help is much appreciated!
 
Last edited:

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
If anyone is interested, I found a much simpler way to solve the problem. It is extremely slow over large data ranges; but pasting html checkboxes into Excel is extremely slow to start with, so I have resigned myself to the wait.

Code:
Sub tickybox_values()
    '
' pulls values from tickyboxes, puts them in the underlying cell, and 
' deletes tickyboxes
    '
Dim o

    For Each o In ActiveSheet.OLEObjects
        If o.progID = "Forms.HTML:Checkbox.1" Then
            o.TopLeftCell.MergeArea.Value = o.Object.Checked
            o.Delete
        End If
    Next o
    '
'replaces true with x and false with a blank
    '
    For Each mycell In Range("c3:k1000")
    mycell.Replace What:="true", Replacement:="X"
    mycell.Replace What:="false", Replacement:=""
    Next

End sub
 
Upvote 0
I am copying a large table of data from a report generated in Firefox and pasting it into Excel 2010. The data has several columns of
html
checkboxes. I need to do two things with the checkboxes and would like to do a third:

1: Count how many checkboxes are ticked in each of the columns.
2: Compare a column A of checkboxes to a column B containing numbers, and then both count and highlight any row where the checkbox is ticked but column B is a 0.
3: (optional) I would like to erase the html checkboxes and, if the box was checked, replace it with a regular x in the underlying cell......


________
jasicajhon
 
Upvote 0
I am copying a large table of data from a report generated in Firefox and pasting it into Excel 2010. The data has several columns of
html
checkboxes. I need to do two things with the checkboxes and would like to do a third:

1: Count how many checkboxes are ticked in each of the columns.
2: Compare a column A of checkboxes to a column B containing numbers, and then both count and highlight any row where the checkbox is ticked but column B is a 0.
3: (optional) I would like to erase the html checkboxes and, if the box was checked, replace it with a regular x in the underlying cell......


________
jasicajhon

emirates check in online
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,165
Members
448,870
Latest member
max_pedreira

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top