View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
FurRelKT FurRelKT is offline
external usenet poster
 
Posts: 42
Default using a user form to add data

bobbo, thank you, your suggestions are most helpful. It's helped to to
figure some of this out.
Question: how do i get the row to add to the 1st activecell that is
empty. It always goes down a row??/ i have tried for i = 0 to 9, any
help would be appreciated.

Private Sub CommandButton2_Click() 'insert row
Dim i As Integer
ActiveSheet.Activate
Cells(8, 1).Select

Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True

For i = 1 To 9
ActiveCell.Offset(i, 0).Value = arrProduct(i)
ActiveCell.Offset(i, 1).Value = arrBankID(i)
ActiveCell.Offset(i, 2).Value = arrProject(i)
ActiveCell.Offset(i, 3).Value = arrServType(i)
ActiveCell.Offset(i, 8).Value = arrAmount(i)
With ActiveCell.Offset(i, 8)
.Value = .Value * 1
.NumberFormat = "_($* #,##0_);_($* (#,##0);_($*
""-""??_);_(@_)"
End With
Next

Call UserForm_Initialize 'clear the form

End Sub