Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi there folks!!!!!
i have this problem. i have an excel workshhet and in column E i have the word "JOHN" appearing in 11 cells of this column. "JOHN" appears in E11, E56, E34 etc. i want the user to select only those cells that contain the word"JOHN". he does that by pressing ctrl button plus he clicks with the mouse on the particular cells i want to write a macro that i can check that the user has clicked on those cells containing the word "JOHN" and no other cells and that the cells are currently selected(means that the user has selected the right cells and then leave them selected) thanks alot ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nikoloas,
try something like this, to check the value of every cell in teh curretnly selected region: Sub IsItJohn() dim NotJohn as Boolean Dim Cl as Range NotJohn = False For Each cl in Selection.Cells If Ucase(cl.value) < "JOHN" Then NotJohn = True End If Next cl If NotJohn = True then ... code when there are other values in the selection ELSE ... code for no other values in selection End if End Sub -----Original Message----- hi there folks!!!!! i have this problem. i have an excel workshhet and in column E i have the word "JOHN" appearing in 11 cells of this column. "JOHN" appears in E11, E56, E34 etc. i want the user to select only those cells that contain the word"JOHN". he does that by pressing ctrl button plus he clicks with the mouse on the particular cells i want to write a macro that i can check that the user has clicked on those cells containing the word "JOHN" and no other cells and that the cells are currently selected(means that the user has selected the right cells and then leave them selected) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Up down arrow keys do not select cells if select locked cells unch | Excel Discussion (Misc queries) | |||
Macro to select cells without a certain value and select a menu it | Excel Worksheet Functions | |||
Using formulas to select cells (Ex: Select every nth cell in a col | Excel Discussion (Misc queries) | |||
how do you "select locked cells" w/o "select unlocked cells"? | Excel Discussion (Misc queries) | |||
Why aren't my cells highlighted when I select multiple cells? | Setting up and Configuration of Excel |