Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Selecting or Activating a cell.

Hi,

I've got this code below, from help of course and thank you very much, but
I'm having a little problem with it.
It all works except for an addition I'm trying to add. I'm trying to make it
select or activate the cell when it finds a cell that contains any of the
words listed, but as I'm only a newbie to this sort of stuff I don't really
know how to do this.
Can someone please help,

Dim astrList(5) As String
Dim lngUpperBound As Long
Dim strText As String
Dim lngIndex As Long
Dim lngRow As Long

'set the upperbound of the array
'(number of words it'll contain)
lngUpperBound = 5

'add words to the array
astrList(0) = "BoB"
astrList(1) = "George"
astrList(2) = "Word"
astrList(3) = "Match?"
astrList(4) = "YES"

'look for any matches in col1
For lngRow = 10 To 100
strText = UCase(ActiveSheet.Cells(lngRow, 1).Value)
For lngIndex = 0 To lngUpperBound - 1
If Instr(1,strText,astrList(lngIndex),1) Then
'Select the Cell, but having a bit of trouble here.
'None of these seem to work, Please help.
'strText.Select, strText.Activate, lngRow.Select,
lngRow.Activate
End If
Next
Next


Thanks
Best regards,
Scott


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
Activating a sound alert on cell value Sebastian Flyte Excel Discussion (Misc queries) 0 December 28th 09 04:12 PM
Activating object from Excel cell Amnon Wilensky Excel Worksheet Functions 2 March 29th 09 06:46 PM
ACTIVATING A SOUND ALERT ON CELL VALUE SOLI Excel Discussion (Misc queries) 10 November 26th 08 02:10 PM
Excel: "De-activating" an e-mail address cell? HowdyPete Excel Discussion (Misc queries) 2 August 17th 06 04:18 PM
Activating cell in a file Roger Excel Discussion (Misc queries) 2 July 7th 05 10:52 PM


All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"