Userform Help

  • Thread starter Thread starter GDillon
  • Start date Start date
G

GDillon

I have tried to create a userform that would allow users to type in the
information in (8) textboxes and when the hit ok it would fill in the
cells on the sheet. this page has 200 rows and 8 cells per row will
contain Data.

If anyone could give details and instructions to help that would be
great.

the sheet name is: Lab Input

a- employee name
b- title
c- rate
d- date
e- hours
f- vehicle info
g- mileage
h- vac allowance

thank you
this is my first post!!:)
 
create your userform. add a button. double click the button. i use something
like this. my userform contains textboxes and comboboxes, so they start with
"CB" and "TB". just use your own names and change he ranges to wherever you want
your data to go when the button is clicked.




Private Sub CommandButton1_Click()
Dim lastrow As Long

Application.ScreenUpdating = False

Worksheets(1).Unprotect
lastrow = Worksheets(1).Cells(Rows.Count, "A").End(xlUp).Row

Range("A" & lastrow + 1) = Me.CBtype.Value
Range("B" & lastrow + 1) = Me.CBcode.Value
Range("C" & lastrow + 1) = Me.TBweight.Value
Range("D" & lastrow + 1) = Me.TBdv.Value
Range("E" & lastrow + 1) = Me.TBFrchg.Value
Range("F" & lastrow + 1) = Me.TBFrtBil.Value
Range("J" & lastrow + 1) = Me.TBzip.Value
Range("K" & lastrow + 1) = Application.Proper(Me.TBcomment.Value)
Range("A" & lastrow + 1 & ":F" & lastrow + 1).Locked = False
Range("J" & lastrow + 1 & ":K" & lastrow + 1).Locked = False

Worksheets(1).Protect

Application.ScreenUpdating =True

End sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top