Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Creating a Checkbox inside a cell for each line

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Creating a Checkbox inside a cell for each line

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Creating a Checkbox inside a cell for each line

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Drop Down List inside a cell? ybkusz Excel Discussion (Misc queries) 1 September 16th 07 07:33 AM
Creating a separate cell entry for every individual line in a cell DaveyC4S Excel Discussion (Misc queries) 4 March 15th 07 05:15 PM
How do I insert a new line of text inside a cell thudson New Users to Excel 4 April 3rd 06 06:08 PM
creating links inside a workbook. Angelica Excel Discussion (Misc queries) 1 October 13th 05 04:10 PM
creating checkbox through form yami-s[_5_] Excel Programming 2 February 18th 04 04:18 PM


All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"