PC Review


Reply
Thread Tools Rate Thread

Change cell value between EMPTY and X when i click on the cell.

 
 
Luc
Guest
Posts: n/a
 
      10th Dec 2009
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

 
Reply With Quote
 
 
 
 
Mike
Guest
Posts: n/a
 
      10th Dec 2009
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
>
> .
>

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      10th Dec 2009
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 <(E-Mail Removed)>
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
>>
>> .
>>


 
Reply With Quote
 
Luc
Guest
Posts: n/a
 
      10th Dec 2009
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
 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      10th Dec 2009
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" <(E-Mail Removed)> wrote in message
news:%239aX%(E-Mail Removed)...
> 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


 
Reply With Quote
 
Luc
Guest
Posts: n/a
 
      10th Dec 2009
Thanks, that really helped me !!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click on an empty cell and the contents of another cell will appear Michael Lanier Microsoft Excel Programming 2 9th Sep 2009 05:24 PM
Change Macro to Find First Empty Cell Jenny B. Microsoft Excel Misc 3 10th Jan 2008 03:25 AM
Change an empty cell back to a blank cell ... LarryLev Microsoft Excel Programming 3 20th Sep 2006 06:23 PM
How to click on a cell and have the content of the cell display in a different cell marin_michael@yahoo.ca Microsoft Excel Worksheet Functions 0 6th Jun 2006 03:05 PM
How do I double click a cell and jump to cell's referenced cell =?Utf-8?B?SmVycnlKdWljZQ==?= Microsoft Excel Misc 2 10th Sep 2005 10:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:18 AM.