LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default HELP WITH A FORM IN EXCEL.

Hi everyone..
Well guys I have this one script below which I got from google back
sometime.
It uses a form to make the lists but generates the list column to
column, like if the list is generated in columnA, the second list
will
be in columnB or the next empty column.
-----------------script start---------------------
Private Sub CommandButton1_Click()
Dim X As Long
Dim LastColumn As Long
Dim Number1 As Variant
Dim Number2 As Variant
Dim TBox1 As String
Dim TBox2 As String
TBox1 = Trim(TextBox1.Text)
TBox2 = Trim(TextBox2.Text)
If TBox1 = "" Or TBox2 = "" Then
MsgBox "You must fill in both text boxes!"
ElseIf TBox1 Like String(Len(TBox1), "#") And Len(TBox2) < 29 Then
Number1 = CDec(TBox1)
If TBox2 Like String(Len(TBox2), "#") And Len(TBox2) < 29 Then
Number2 = CDec(TBox2)
If Number2 < Number1 Then
MsgBox "Ending number must contain an equal or larger number
than Starting!"
Else
LastColumn = Cells(1, Columns.Count).End(xlToLeft).Column
If LastColumn = 1 And Range("A1").Value = "" Then LastColumn
=
0
For X = 0 To Number2 - Number1
Cells(X + 1, LastColumn + 1).Value = _
"'" & Format$(Number1 + X, String(Len(Trim(TBox1)),
"0"))
Next
End If
Else
MsgBox "Bad entry in Ending text box"
End If
Else
MsgBox "Bad entry in Starting text box"
End If
End Sub
-----------------script end---------------------


The form at the moment has two text boxes
START
END
with one button "GENERATE LIST". that all.


I was wondering if you can add another drop downlist in the form with
item name list and a text box with date in it.
User input will require


Start
End
Item name (to be selected from drop down list which can be updated
from time to time with new item names)
Location ( to be selected from drop down list which can be updated
from time to time with new item names )
Date (dd/mm/yyyy)
Extra infomation1 text box (additional column which I can use later
on
so that i dont bug ya to add another test box in the form for me :) )
Extra infomation2 text box (additional column which I can use later
on so that i dont bug ya to add another test box in the form for
me :) )
Extra infomation3 text box (additional column which I can use later
on so that i dont bug ya to add another test box in the form for
me :) )


The original file that i'm using is at
http://www.filefactory.com/file/a0e6...erate_List_xls


I have modified the form which is in file "Generate List required" at
http://www.filefactory.com/file/a0e6...t_required_xls
This is the file that needs to be fixed.

Thankyou.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel form. Need data extracted to spreadsheet each time a form co MikeR-Oz Excel Discussion (Misc queries) 4 April 5th 09 05:18 AM
Can a form made in Excel 2002 be converted into a fillable form? Paraclete Excel Discussion (Misc queries) 1 February 20th 07 09:20 PM
Transfer data to form from Excel range upon loading of form. Rob Crawford Excel Programming 2 October 24th 05 03:59 PM
I created a form on excel. want to edit the form without printing Oz Excel Discussion (Misc queries) 1 September 1st 05 08:18 PM
form in excel to be attached to the emails address in the form upon sumission Abdulkader Bhanpurawala via OfficeKB.com Excel Programming 6 July 10th 05 10:48 AM


All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"