Thread: input box loop
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default input box loop

See my post.
--
Cheers,
Ryan


"tpeter" wrote:

Jocob thank you for your help. I am a little confused. The macro I created
works the only thing I need to do is some type of trigger for the macro to
run again. Once the number is found in column b then it offsets 20 columns
and stops. That is great then I enter my numbers accordingly an example would
be the macro found info in cell c14 it then offsets to v14, I enter
information in cells v14,w14,x14v and y14. When I exit y14 I want the macro
to run again.

"Jacob Skaria" wrote:

Check out the VBA help on .FindNext method

Example (from help)
This example finds all cells in the range A1:A500 that contain the value 2
and changes their values to 5.

With Worksheets(1).Range("a1:a500")
Set c = .Find(2, lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Value = 5
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With


--
Jacob


"tpeter" wrote:

I have a large spreadsheet in excel 2003 that I need to find a number and
offset it to input new data. I have this code working:

Sub findbadge()
'
' findbadge Macro
' Macro recorded 2/9/2010 by tpeter
'
strBadge = InputBox("Enter Badge Number", "Badge Number")
Range("B15").Select
Cells.Find(What:=strBadge, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
With ActiveCell
.Offset(, 20).Select
End With

End Sub

There are 4 pieces of data that I need to put in (this adjusted me over 4
columns). When I put the last number in (column "Y") I want it to repeat the
above macro. any help would be great, and thank you for your help.

Tim Peter