Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default replicate feel of checkbox

My question is- is there a way to replicate the feel of a checkbox
within an
excel cell where one click on the cell sets the cell to a certain
value , say
"X", and another click on the cell sets it to a different value, say
"" .

I've received direction (below) on how to do this with a single
column, but I need to do it with two noncontiguous columns (column C
and H but not the columns in between)


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Columns("B:B"), Target) Is Nothing Then Exit Sub
If Target.Count 1 Then Exit Sub
If Target.Value = "" Then
Target.Value = "X"
Else
Target.Value = ""
End If

End Sub

Any help would be appreciated.

Thanks,

Robert

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default replicate feel of checkbox

If the code you have does what you want but only for a single range then you
can modify it a number of ways, here's a quick one:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Columns("B:B"), Target) Is Nothing Then
If Intersect(Columns("D:D"), Target) Is Nothing Then Exit Sub
End If
If Target.Count 1 Then Exit Sub
If Target.Value = "" Then
Target.Value = "X"
Else
Target.Value = ""
End If

End Sub
--
Cheers,
Shane Devenshire


"robnsd" wrote:

My question is- is there a way to replicate the feel of a checkbox
within an
excel cell where one click on the cell sets the cell to a certain
value , say
"X", and another click on the cell sets it to a different value, say
"" .

I've received direction (below) on how to do this with a single
column, but I need to do it with two noncontiguous columns (column C
and H but not the columns in between)


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Columns("B:B"), Target) Is Nothing Then Exit Sub
If Target.Count 1 Then Exit Sub
If Target.Value = "" Then
Target.Value = "X"
Else
Target.Value = ""
End If

End Sub

Any help would be appreciated.

Thanks,

Robert


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default replicate feel of checkbox

On Feb 3, 2:37 pm, ShaneDevenshire
wrote:
If the code you have does what you want but only for a single range then you
can modify it a number of ways, here's a quick one:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Columns("B:B"), Target) Is Nothing Then
If Intersect(Columns("D:D"), Target) Is Nothing Then Exit Sub
End If
If Target.Count 1 Then Exit Sub
If Target.Value = "" Then
Target.Value = "X"
Else
Target.Value = ""
End If

End Sub
--
Cheers,
Shane Devenshire



"robnsd" wrote:
My question is- is there a way to replicate the feel of a checkbox
within an
excel cell where one click on the cell sets the cell to a certain
value , say
"X", and another click on the cell sets it to a different value, say
"" .


I've received direction (below) on how to do this with a single
column, but I need to do it with two noncontiguous columns (column C
and H but not the columns in between)


Private Sub Worksheet_SelectionChange(ByVal Target As Range)


If Intersect(Columns("B:B"), Target) Is Nothing Then Exit Sub
If Target.Count 1 Then Exit Sub
If Target.Value = "" Then
Target.Value = "X"
Else
Target.Value = ""
End If


End Sub


Any help would be appreciated.


Thanks,


Robert- Hide quoted text -


- Show quoted text -


Thanks for your help. That did the trick.

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
checkbox gets value not sets value Marquel Excel Discussion (Misc queries) 1 December 27th 06 10:23 PM
Hiding a ComboBox with a Checkbox AWeb Excel Worksheet Functions 2 September 15th 06 01:30 PM
Checkbox functionality Basia Excel Discussion (Misc queries) 2 June 19th 06 04:42 PM
Page printing and checkbox protection balcovja Excel Discussion (Misc queries) 1 November 25th 05 02:13 PM
copy many CHECKBOX Taha Elian Excel Discussion (Misc queries) 1 April 28th 05 06:06 PM


All times are GMT +1. The time now is 02:20 PM.

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"