Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Change cell value between EMPTY and X when i click on the cell.

Hello,

How can i change the cell value between empty and X when i click on the
cell.
This is for the cells in column B of all the visible sheets.

Can you provide some code please.....

Thanxxxx,

Luc

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Change cell value between EMPTY and X when i click on the cell.

Paste this code into all visable sheets and change the range of B1:B10 to
your needs
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B1:B10")) Is Nothing Then
Target.Value = "X"
End If
End Sub

"Luc" wrote:

Hello,

How can i change the cell value between empty and X when i click on the
cell.
This is for the cells in column B of all the visible sheets.

Can you provide some code please.....

Thanxxxx,

Luc

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Change cell value between EMPTY and X when i click on the cell.

No need to paste Mike's code into all worksheets.

Paste this code once into Thisworkbook module.

Private Sub Workbook_SheetSelectionChange _
(ByVal Sh As Object, ByVal Target As Range)
If Not Intersect(Target, Range("B1:B10")) Is Nothing Then
Target.Value = "X"
End If
End Sub

Covers all sheets.


Gord Dibben MS Excel MVP

On Thu, 10 Dec 2009 10:54:01 -0800, Mike
wrote:

Paste this code into all visable sheets and change the range of B1:B10 to
your needs
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B1:B10")) Is Nothing Then
Target.Value = "X"
End If
End Sub

"Luc" wrote:

Hello,

How can i change the cell value between empty and X when i click on the
cell.
This is for the cells in column B of all the visible sheets.

Can you provide some code please.....

Thanxxxx,

Luc

.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Change cell value between EMPTY and X when i click on the cell.

Thanks guys,

But i also want to change the cell to Empty if the value is "X"
and change to "X" if it is empty (a kind of toggle)

Luc
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Change cell value between EMPTY and X when i click on the cell.

Try it this way then...

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B1:B10")) Is Nothing Then
If Target.Value = "" Then
Target.Value = "X"
Else
Target.Value = ""
End If
End If
End Sub

--
Rick (MVP - Excel)


"Luc" wrote in message
...
Thanks guys,

But i also want to change the cell to Empty if the value is "X" and
change to "X" if it is empty (a kind of toggle)

Luc




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Change cell value between EMPTY and X when i click on the cell.

Thanks, that really helped me !!
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
Change Cell colour on click goneil Excel Discussion (Misc queries) 2 October 22nd 09 01:20 AM
I need to set pointer to change a cell(s)with 1 click mash Excel Worksheet Functions 0 February 3rd 09 08:58 PM
Right click to change cell values Linn Pallesen Excel Programming 3 November 1st 08 10:48 PM
Change an empty cell back to a blank cell ... LarryLev[_2_] Excel Programming 3 September 20th 06 06:23 PM
Change cell back color on click Dave Peterson Excel Discussion (Misc queries) 0 January 24th 05 10:50 PM


All times are GMT +1. The time now is 07:44 AM.

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

About Us

"It's about Microsoft Excel"