Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Maxemily
 
Posts: n/a
Default Select One Cell or Another


Hello,

How would I allow someone to put an 'x' in one of two cells but not in
both?

Also, as there would need to be an 'x' in one of the two cells only if
there were text in a different cell, is there a way to indicate the
need for the 'x' should text be inserted but the 'x' omitted?

Clear as mud huh?

Thanks


--
Maxemily
  #2   Report Post  
Posted to microsoft.public.excel.misc
davesexcel
 
Posts: n/a
Default Select One Cell or Another


Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If Union(Range("$A:$A"), Target).Address = Range("$A:$A").Address Then
With Selection.Font
.Name = "Webdings"
End With
ActiveCell.FormulaR1C1 = "r"
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.ClearContents
End If
Cancel = True

If Union(Range("$B:$B"), Target).Address = Range("$B:$B").Address Then


With Selection.Font
.Name = "Webdings"
End With
ActiveCell.FormulaR1C1 = "r"
ActiveCell.Offset(0, -1).Range("A1").Select
Selection.ClearContents
End If

End Sub


Here's a macro I just recorded, using macro recorder then inserted the
code into the worksheet module

right click on the sheet tab and select view codes
there will be a box with the word (GENERAL)
hit the arrow to select worksheet
copy and paste the above code into that worksheet module

Now right click a cell in column A or B and a x mark will show in one
of the cells


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=528905

  #3   Report Post  
Posted to microsoft.public.excel.misc
Door
 
Posts: n/a
Default Select One Cell or Another


The simple way is to use conditional format on the two 'X' cells,
specify two conditions, (assuming text in A1, and x in B1 or C1)

for cell B1 - conditional format Formula=
=AND(A1="",B1="x")
set cell colour to red, and a second condition
=AND(C1="x",B1="x")
set cell colour to red

for cell C1, almost the same
=AND(A1="",C1="x")
set cell colour to red, and
=AND(C1="x",B1="x")
set cell colour to red

The other way is to use VBA code.




Maxemily Wrote:
Hello,

How would I allow someone to put an 'x' in one of two cells but not in
both?

Also, as there would need to be an 'x' in one of the two cells only if
there were text in a different cell, is there a way to indicate the
need for the 'x' should text be inserted but the 'x' omitted?

Clear as mud huh?

Thanks


--
Maxemily



--
Door
------------------------------------------------------------------------
Door's Profile: http://www.excelforum.com/member.php...o&userid=33068
View this thread: http://www.excelforum.com/showthread...hreadid=528905

  #4   Report Post  
Posted to microsoft.public.excel.misc
Maxemily
 
Posts: n/a
Default Select One Cell or Another


Thanks for your help.

Now I have a new problem: all but the security option in Tools/Macro is
faded out no matter which security setting is used.

Help a noob(ish) out please!


--
Maxemily
  #5   Report Post  
Posted to microsoft.public.excel.misc
davesexcel
 
Posts: n/a
Default Select One Cell or Another


which option did you take??


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=528905



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
I cannot select a single cell or pull down cell contents Carolyn Fahm Excel Worksheet Functions 0 January 24th 06 04:54 PM
Select cell, Copy it, Paste it, Return to Previous cell spydor Excel Discussion (Misc queries) 1 December 30th 05 01:29 PM
Select cell containing specific text &return value from another ce plf100 Excel Worksheet Functions 4 November 16th 05 01:57 PM
enhanced conditional formatting Stuart Excel Discussion (Misc queries) 13 November 13th 05 07:20 PM
select a cell and the one next to it Donna S Excel Discussion (Misc queries) 3 November 4th 05 06:53 PM


All times are GMT +1. The time now is 05:37 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"