Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Find value with the help of macro.

Hi,

Normally in excel we find a value with the help of ctrl+F and then
find it.

But when i recored a macro to do the same it is giving an error can
some help me to solve this issue.

All the values in my sheet are unique value.

Regards

Heera
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Find value with the help of macro.

I'm guessing you recorded a macro when you tried to find something. And in that
recorded code, there was a .activate line.

If the value wasn't found, then the .activate will fail.

Dim FoundCell as range
set foundcell = activesheet.range("a1:b99").find(....)

if foundcell is nothing then
msgbox "not found"
else
foundcell.select
end if

Heera wrote:

Hi,

Normally in excel we find a value with the help of ctrl+F and then
find it.

But when i recored a macro to do the same it is giving an error can
some help me to solve this issue.

All the values in my sheet are unique value.

Regards

Heera


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Find value with the help of macro.

My problem is this.

I have two workbooks.

In 1st workbook there is a value.


My macro should go to the 2nd workbook and find the value of 1st
workbook on which my cursor is.


for example 1st workbooks has a value 50K in C6 cell
then My macro should go in 2nd workbook and find 50K in selected
range.
then again it should come back to the C6 cell of 1st workbook.

Again the same loop for the cell value which is there in C7.

I recoreded a Macro of (ctrl+f ) but it is giving an error.


Regards


Heera




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Find value with the help of macro.

Hi

Here is something I did write on fly - check this out.

------
Sub SearchEntry()

Dim MyString As String
Dim MyCase As Boolean

MyString = InputBox("Enter the string to search!")
MyCase = MsgBox("Do you want the search to be case sensitive?", vbYesNo)

On Error GoTo NoString

ActiveSheet.UsedRange.Find(What:=MyString, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=MyCase).Activate
Exit Sub

NoString:
MsgBox "The string was not found!"

End Sub
------------


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )




"Heera" wrote in message
...
Hi,

Normally in excel we find a value with the help of ctrl+F and then
find it.

But when i recored a macro to do the same it is giving an error can
some help me to solve this issue.

All the values in my sheet are unique value.

Regards

Heera



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Find value with the help of macro.

Share what your code is so far.

Heera wrote:

My problem is this.

I have two workbooks.

In 1st workbook there is a value.

My macro should go to the 2nd workbook and find the value of 1st
workbook on which my cursor is.

for example 1st workbooks has a value 50K in C6 cell
then My macro should go in 2nd workbook and find 50K in selected
range.
then again it should come back to the C6 cell of 1st workbook.

Again the same loop for the cell value which is there in C7.

I recoreded a Macro of (ctrl+f ) but it is giving an error.

Regards

Heera


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Find value with the help of macro.

Thank you Dave and Arvi both of your codes were helpfull in a
different way.......I got the hint looking at your code....thanks a
lot....
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
Find & Replace and Find & Insert macro help needed RS Excel Programming 2 January 29th 07 07:35 AM
Get Macro warning, but can't find Macro Stilla Excel Worksheet Functions 1 January 20th 07 01:27 AM
change error message when no more for "find" in macro to find swyltm Excel Programming 1 January 13th 06 05:16 PM
I need to find a macro to find data cut and paste to another colu. Rex Excel Programming 6 December 7th 04 09:22 AM
Can't find a macro Bob Potts Excel Programming 2 December 10th 03 07:02 PM


All times are GMT +1. The time now is 05:02 PM.

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"