Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am importing a text file into spreadsheet one line at a time, I
would like to add a checkbox for each line for the user to be able to select multiple rows. How do i create a checkbox in a cell? Then remove it. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Randy,
Here is an laternative approach I have previously suggested Another way is to use this technique of having a check column, and monitoring it with a worksheet selection change event. Add your code as needed. Rather than use a checkbox, I suggest just using a check column. So if we assume that the data is in A1:E100 (change to suit), clicking in column A will do what you want with this code. Add this code to the worksheet module (right-click on the sheet name tab, select the View option, and then paste this code in). Private Sub Worksheet_SelectionChange(ByVal Target As Range) Application.EnableEvents = False On Error GoTo sub_exit If Not Intersect(Target, Range("A1:A100")) Is Nothing Then With Target If .Value = "a" Then .Value = "" Else .Value = "a" .Font.Name = "Marlett" End If End With End If sub_exit: Application.EnableEvents = True End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Randy Reese" wrote in message ... I am importing a text file into spreadsheet one line at a time, I would like to add a checkbox for each line for the user to be able to select multiple rows. How do i create a checkbox in a cell? Then remove it. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I when with this code, trying to use checkboxes slowed the system down
to a crawl. Sometimes the rows can be thousands long. Now I would like to make the row background color yellow when checked, can you help with this, I can make the same cell change but not the row. On Thu, 19 Feb 2004 15:53:31 -0000, "Bob Phillips" wrote: Randy, Here is an laternative approach I have previously suggested Another way is to use this technique of having a check column, and monitoring it with a worksheet selection change event. Add your code as needed. Rather than use a checkbox, I suggest just using a check column. So if we assume that the data is in A1:E100 (change to suit), clicking in column A will do what you want with this code. Add this code to the worksheet module (right-click on the sheet name tab, select the View option, and then paste this code in). Private Sub Worksheet_SelectionChange(ByVal Target As Range) Application.EnableEvents = False On Error GoTo sub_exit If Not Intersect(Target, Range("A1:A100")) Is Nothing Then With Target If .Value = "a" Then .Value = "" Else .Value = "a" .Font.Name = "Marlett" End If End With End If sub_exit: Application.EnableEvents = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating Drop Down List inside a cell? | Excel Discussion (Misc queries) | |||
Creating a separate cell entry for every individual line in a cell | Excel Discussion (Misc queries) | |||
How do I insert a new line of text inside a cell | New Users to Excel | |||
creating links inside a workbook. | Excel Discussion (Misc queries) | |||
creating checkbox through form | Excel Programming |