userform and inputboxes

P

pswanie

im new to userfroms and please need help with the following code.
all that i done so far is to right click and insert user form and add
label1
textbox1
textbox2
textbox3
commandbutton1


label1 needs to display info from sheet1 range c & d & e

textbox1 contains a brief description and goes in sheet 1 colum c down(find
next open cell downwards)

textbox2 contains a date and goes next open cell down in sheet1 colum d

textbox3 contains a date and goes next open cell down in sheet1 colum e

commandbutton1 = save/ok (puts the data enterd in the three textboxes in the
correct range

we got a number of specials runing at once but they dont all start or end on
the same day. now i need this userform to pop up when the workbook are
opened
and tell the user what specials are currently running and when it started and
when its going to end.

on sheet1 it self (called "sheet1") i need the discription in column c
down and column d will be the start date and column e the end date. and if
possible if the system can see when it ends and the day after it end delete
the entry.
 
D

Dan R.

I'd suggest you check out one of John Walkenbach's books if you want
to learn Excel but this should get you started:

Put this code in 'ThisWorkbook' to display the userform when the
workbook opens:
Private Sub Workbook_Open()
UserForm1.Show Modless
End Sub

Then put this code in your userform:
Private Sub CommandButton1_Click()
Dim lRow As Long, i As Integer
For i = 3 To 5
lRow = Cells(Rows.Count, i).End(xlUp).Row
Cells(lRow + 1, i) = Me.Controls("TextBox" & i - 2).Value
Next i
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

Top