Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default select particular cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default select particular cells

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
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
Up down arrow keys do not select cells if select locked cells unch roandrob Excel Discussion (Misc queries) 3 May 18th 09 12:48 AM
Macro to select cells without a certain value and select a menu it Guy[_2_] Excel Worksheet Functions 9 January 2nd 09 05:21 PM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
how do you "select locked cells" w/o "select unlocked cells"? princejohnpaulfin Excel Discussion (Misc queries) 3 July 16th 05 03:53 AM
Why aren't my cells highlighted when I select multiple cells? TChristian Setting up and Configuration of Excel 0 January 26th 05 10:23 PM


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