MrExcel Publishing
Your One Stop for Excel Tips & Solutions

been fighting with this one...time to ask an expert!!


Posted by Patrick on April 19, 2001 5:00 PM

I want my values in the of the test boxes
to start in Column B.....no matter what
I change in the range formula it starts in Column A
help....suggestions!!

Private Sub CommandButton1_Click()
Enter.Hide
MainMenu.Show
End Sub

Private Sub CommandButton2_Click()
Dim Nextrow As Integer
Sheet5.Activate
Nextrow = Application.WorksheetFunction.CountA(Range("B:B")) + 2
If TextBox1.Value = " " Then
MsgBox "Name field cannot be empty."
Exit Sub
Else
If TextBox2 = "" Then
MsgBox "Name field cannot be empty."
Exit Sub
Else
Sheet5.Cells(Nextrow, 1).Value = TextBox1.Value
Sheet5.Cells(Nextrow, 3).Value = TextBox2.Value
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.SetFocus
End If
End If
End Sub

Private Sub UserForm_Click()

End Sub


Posted by Dave Hawley on April 19, 2001 7:24 PM

Hi Patrick

You have the Column Argument of the Cells method set to 1 (Column A) try this:

Sheet5.Cells(Nextrow, 2).Value = TextBox1.Value

Dave
OzGrid Business Applications

Posted by Patrick on April 20, 2001 2:18 AM

opps......I guess I press the panic button
to quick......thanks again Dave
honestly.....I am shaking my head.... smiles

Posted by Dave Hawley on April 20, 2001 3:04 AM

Hey! Don't worry I've done worse :o)

OzGrid Business Applications