Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Using the Find method with formulas

I have a worksheet say Sheet1 that has values in column 1.

On Sheet 2 in column 1 I have formulas such as "=Sheet1!A1" etc.

I set the range to Worksheet("Sheet2").Range("A1:A1000").

The value 100 exist in column 1 of Sheet1.

I want to search the range for 100.

Set rRange = Worksheet("Sheet2").Range("A1:A1000")
rRange.Find(What:=100,LookIn:=xlValues,LookAt:=xlW hole)

Return Nothing.

Any suggestions?







*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Using the Find method with formulas

Edward,

Sub NewSub()
Dim rRange As Range
Dim myCell As Range

Set rRange = Worksheets("Sheet2").Range("A1:A1000")
Set myCell = rRange.Find(What:=100, LookIn:=xlValues, LookAt:=xlWhole)
If Not myCell Is Nothing Then
MsgBox myCell.Address & " has the value ""100"""
Else
MsgBox "Not Found"
End If
End Sub

HTH,
Bernie
MS Excel MVP



"Edward Ulle" wrote in message
...
I have a worksheet say Sheet1 that has values in column 1.

On Sheet 2 in column 1 I have formulas such as "=Sheet1!A1" etc.

I set the range to Worksheet("Sheet2").Range("A1:A1000").

The value 100 exist in column 1 of Sheet1.

I want to search the range for 100.

Set rRange = Worksheet("Sheet2").Range("A1:A1000")
rRange.Find(What:=100,LookIn:=xlValues,LookAt:=xlW hole)

Return Nothing.

Any suggestions?







*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Using the Find method with formulas

Bernie,

I have done as you suggested but it still doesn't work.

Dim rRange As Range
Dim rFind As Range

Set rRange = Worksheet("Sheet2").Range("A1:A1000")
Set rFind = rRange.Find(What:=100,LookIn:=xlValues,LookAt:=xlW hole)

As a matter of fact if you try to search from the menu for 100 on the
column of Sheet2 it says not found. I tied formulas, values without
success.

It seems the formulas "=Sheet1!Axxx" do not reveal the value. I am
using Office 2000 if that makes a difference.

Thanks.

Ed


*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Using the Find method with formulas

Ed,

What formatting do you have on your sheet? Remember, Excel uses the display value as the basis of
the search, not the actual value. So if your cell shows 100.00, you need to use

Set rFind = rRange.Find(What:="100.00", LookIn:=xlValues, LookAt:=xlWhole)

HTH,
Bernie
MS Excel MVP


"Edward Ulle" wrote in message ...
Bernie,

I have done as you suggested but it still doesn't work.

Dim rRange As Range
Dim rFind As Range

Set rRange = Worksheet("Sheet2").Range("A1:A1000")
Set rFind = rRange.Find(What:=100,LookIn:=xlValues,LookAt:=xlW hole)

As a matter of fact if you try to search from the menu for 100 on the
column of Sheet2 it says not found. I tied formulas, values without
success.

It seems the formulas "=Sheet1!Axxx" do not reveal the value. I am
using Office 2000 if that makes a difference.

Thanks.

Ed


*** Sent via Developersdex http://www.developersdex.com ***



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Using the Find method with formulas


Bernie,

I am developing an application in Excel to use another applications
model data and perform post processing not available in the application.

I have discovered that as I have been developing this Excel VBA app, and
debugging coding errors, the workbook gets "corrupted".

I exported the entire project and reimported to a new workbook and now
it works.

Thanks for your help though.

Ed


*** 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
Using variables to make a date and using find method to find that. KyWilde Excel Programming 2 April 21st 05 09:43 PM
Find Method Garry Douglas Excel Programming 0 December 31st 04 02:31 AM
with -.find end with method Peter[_21_] Excel Programming 1 December 26th 04 11:49 AM
Find method benb Excel Programming 0 September 22nd 04 10:17 PM
Using Find method wade Excel Programming 3 March 3rd 04 07:05 AM


All times are GMT +1. The time now is 12:29 AM.

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"