Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find & Replace and Find & Insert macro help needed | Excel Programming | |||
Get Macro warning, but can't find Macro | Excel Worksheet Functions | |||
change error message when no more for "find" in macro to find | Excel Programming | |||
I need to find a macro to find data cut and paste to another colu. | Excel Programming | |||
Can't find a macro | Excel Programming |