Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Search a Range take Action


Hi

Can any one help?

If I had a set of values in a given range of a Spread Sheet, let’s say
the numbers 1-10 in cells B1 - B10.

Using VBA What code would I require to search the range looking for lets
say "3". When found a value lets say "Yes" would be put into cell C3 or
any cell to the left of where the value 3 was found.


Many thanks Kev


*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Search a Range take Action

Sub Locate()
Dim rng As Range
Dim iAns As Integer
Set rng = Application.InputBox("Enter range, e.g. A1:A8, by typing
or sweeping cells.", Type:=8)
iAns = Application.InputBox("Look for what?")
For Each c In rng
If c = iAns Then c.Offset(0, 1) = "Yes"
Next c
End Sub

Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Search a Range take Action


Many Thanks

Kev


*** Sent via Developersdex http://www.developersdex.com ***
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
Performing Action on a Range of Rows JohnB[_2_] Excel Discussion (Misc queries) 1 July 20th 07 01:48 AM
Performing Action on a Range of Rows JohnB[_2_] Excel Discussion (Misc queries) 2 July 19th 07 06:22 PM
Loop through range of cells, string search, take action [email protected] Excel Programming 1 November 3rd 06 12:56 PM
Problem with action on range change Marty Excel Programming 4 September 12th 06 01:28 AM
Can I protect a range of worksheets in a book with one action? Sussex Fran Excel Worksheet Functions 2 June 10th 05 03:02 PM


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