View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Enter data in next empty row after cell name

Private Sub cmdAdd_Click()
Dim LastRow As Range
Dim ws as Worksheet
Set ws = ActiveSheet
LastRow = ws.columns(1).Find("NametoSearchfor")
if not LastRow is nothing then
LastRow.offset(1,0).EntireRow.Insert
LastRow.Offset(1, 0).Value = txtCust.Text
LastRow.Offset(1, 1).Value = txtService.Text
LastRow.Offset(1, 2).Value = txtCircuit.Text
End if
End Sub

change NametoSearchfor to the actual value in the cell you are looking for

--
regards,
Tom Ogilvy

"Mark Cover" wrote in message
...
I need some help entering data from a form. I have the sheet activaced

and
want to select the next row after a paticular name and past information

from
that cell.
I hope this is clear: Here is what i have.

Private Sub cmdAdd_Click()
Dim iRow As Long
Dim LastRow As Object
Set ws = ThisWorkbook.ActiveSheet()
Set LastRow = ws.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = txtCust.Text
LastRow.Offset(1, 1).Value = txtService.Text
LastRow.Offset(1, 2).Value = txtCircuit.Text

Thanks -mark