Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I cannot select a single cell or pull down cell contents | Excel Worksheet Functions | |||
Select cell, Copy it, Paste it, Return to Previous cell | Excel Discussion (Misc queries) | |||
Select cell containing specific text &return value from another ce | Excel Worksheet Functions | |||
enhanced conditional formatting | Excel Discussion (Misc queries) | |||
select a cell and the one next to it | Excel Discussion (Misc queries) |