View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Help with userform?

Dim iPos as long

Set rng = worksheets("Sheet1").Range("A1:A10")
On Error Resume Next
iPos = Application.Vlookup(Listbox1.Value,
On Error Goto 0
If iPos 0 Then
worksheets("Sheet1").Cells(iPos,"E").Value = _
worksheets("Sheet1").Cells(iPos,"E").Value + Textbox1.Text
worksheets("Sheet1").Cells(iPos,"F").Value = _
worksheets("Sheet1").Cells(iPos,"F").Value + Textbox2.Text
End If

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Greg B" wrote in message
...
I have a userform with a listbox and a couple of textbox's

I want to have a macro that will lookup the name in the listbox on a sheet
called "reg" and have textbox1 add its amount to the amount in column e

and
textbox2 add its total to column f on the same row.

Thanks

Greg