Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm using a userform with textboxes to fill in data. Which then gets placed
in the next available row between C10:C19. So far I have the following code written. Can anyone help and see what changes I need to make to achieve my goal? Private Sub CommandButton1_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("sheet2") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ ..End(xlUp).Offset(1, 0).Row + 1 'check for a part number If Trim(Me.TextBox1.Value) = "" Then Me.TextBox1.SetFocus MsgBox "Please enter a date" Exit Sub End If 'copy the data to the database ws.Cells(10, 3).Value = Me.TextBox1.Value ws.Cells(10, 4).Value = Me.TextBox2.Value ws.Cells(10, 5).Value = Me.TextBox3.Value ws.Cells(10, 6).Value = Me.TextBox4.Value ws.Cells(10, 7).Value = Me.TextBox5.Value 'clear the data Me.TextBox1.Value = "" Me.TextBox2.Value = "" Me.TextBox3.Value = "" Me.TextBox4.Value = "" Me.TextBox5.Value = "" Me.TextBox1.SetFocus End Sub -- ASU |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Leaving an empty cell empty | Excel Discussion (Misc queries) | |||
why a reference to an empty cell is not considered empty | Excel Discussion (Misc queries) | |||
Find an empty cell and put a dash in it? | Excel Worksheet Functions | |||
Using the Find tool in EXCEL | Excel Worksheet Functions | |||
Excel has a "Find Next" command but no "Find Previous" command. | Excel Discussion (Misc queries) |