Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default selecting range of cells - variable # of rows

"cell" should be "cells"

Sub FindSomething()
dim rng as Range
dim res as String
res = InputBox("Enter string to find")
if res < "" then
set rng = cells.Find(What:=res, _
After:=Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
if not rng is nothing then
rng.Activate
end if
End if
End Sub

Change xlPart to xlWhole if you want to match the entire value of the cell.
Change xlFormulas to xlValue if you want to find something produced by a
formula.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
Sub FindSomething()
dim rng as Range
dim res as String
res = InputBox("Enter string to find")
if res < "" then
set rng = cell.Find(What:=res, _
After:=Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
if not rng is nothing then
rng.Activate
end if
End if
End Sub

Change xlPart to xlWhole if you want to match the entire value of the

cell.
Change xlFormulas to xlValue if you want to find something produced by a
formula.

--
Regards,
Tom Ogilvy


"gmunro" wrote in message
oups.com...
I am having a similar problem based on finding the value of an
inputbox, where in the above example ine input box entry might be "X3Z"

Any help greatly appreciated





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
selecting a variable row range Dan Excel Programming 2 March 5th 05 12:03 PM
Selecting a variable range Dan Excel Programming 2 November 2nd 04 06:02 AM
Selecting Variable Rows Matt D. Excel Programming 3 June 18th 04 07:22 PM
Selecting rows with variable Jim[_24_] Excel Programming 7 September 16th 03 02:03 PM
Selecting a Range Using a Variable Bob J. Excel Programming 4 September 14th 03 09:24 PM


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