Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, Can someone please help me here - trying to get Find and FindNext to work within to populate data within a form to enable it to be edited. Private Sub CommandButton1_Click() Dim Loc As String Loc = Format(TextBox1.Value, "####") Sheets("Sheet1").Select Cells.Find(What:=Loc, After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext).Activate With Worksheets("Sheet1") Set C = .Range("A:A").Find(Loc, LookIn:=xlValues) If Not C Is Nothing And .Cells(C.Row, 1) < Loc Then firstAddress = C.Address Do Set C = .Range("A:A").FindNext(C) Loop While Not C Is Nothing And .Cells(C.Row, 1) < Loc And C.Address < firstAddress TextBox2 = .Cells(C.Row, 2) TextBox3 = .Cells(C.Row, 3) End With End Sub Cheers, Bernz -- BernzG ------------------------------------------------------------------------ BernzG's Profile: http://www.excelforum.com/member.php...o&userid=22949 View this thread: http://www.excelforum.com/showthread...hreadid=395711 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Nesting Find and FindNext | Excel Programming | |||
Using 'Find' and 'FindNext' in vba | Excel Programming | |||
Find Findnext in selected range | Excel Programming | |||
Find, Findnext VBA Loop | Excel Programming | |||
Find...FindNext Problem | Excel Programming |