![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 1,301
|
I want to write a macro that first give me the possibility to enter a message in a text box and then give me the active cell.
Ex. I have 700 lines in column A AAA BBB CCC DDD etc.. When I can give in a textbox DDD than the program goes automatickly to line 4 with the text DDD Have anyone such a macro? Many thanks. |
|
|
|
|
|
#2 | |
|
Board Regular
Join Date: Mar 2002
Posts: 1,828
|
Quote:
I am far from being an expert in VBA but I tried this and it seems to work, although maybe it needs some polish: Sub SeekValue() Range("A1").Select ABC = InputBox("Enter value to seek ") Cells.Find(What:=ABC, After:=ActiveCell).Activate End Sub Regards, Eli [ This Message was edited by: eliW on 2002-03-29 07:14 ] |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 1,828
|
Does it make sense?
Eli |
|
|
|
|
|
#4 | ||
|
Board Regular
Join Date: Mar 2002
Posts: 1,301
|
Quote:
|
||
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Just change Eli's code to;
Sub SeekValue() Dim abc Range("A1").Select abc = InputBox("Enter value to seek ") On Error Resume Next Cells.Find(What:=abc, After:=ActiveCell).Activate If Err Then MsgBox abc & " Not found!" End Sub Ivan |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|