ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   userform and inputboxes (https://www.excelbanter.com/excel-programming/403556-userform-inputboxes.html)

pswanie

userform and inputboxes
 
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.


Dan R.

userform and inputboxes
 
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

--
Dan

On Jan 3, 2:43*am, pswanie wrote:
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.



All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com