LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Form/Input box

Not fully tested but something like the following may be of help.
It checks for Unique ID in Col A and if not found Prompts for Name, Compnay
Name & adds to a Worksheet I named Prize Draw (Change code if different) All
Entries are Date & Time Stamped.

Hope useful

Sub PrizeDraw()

Dim UID As Variant
Dim EntrantName As Variant
Dim CoName As Variant
Dim FoundCell As Range

Title = "Prize Draw"
UID = Application.InputBox(prompt:="Enter Unique ID", Title:="Prize
Draw", Type:=2)
If VarType(UID) = vbBoolean Then
If UID = False Then
Debug.Print "cancelled"
Exit Sub
End If
End If

Search = UID
With ThisWorkbook.Worksheets("Prize Draw")
Set FoundCell = .Columns(1).Find(Search, LookIn:=xlValues,
LookAt:=xlWhole)


If FoundCell Is Nothing = False Then
msg = MsgBox("UID " & UID & " Exists", 16, Title)

Else

EntrantName = Application.InputBox(prompt:="Enter Entrant's
Name", Title:="Prize Draw", Type:=2)
If VarType(EntrantName) = vbBoolean Then
If EntrantName = False Then
Debug.Print "cancelled"
Exit Sub
End If
End If
CoName = Application.InputBox(prompt:="Enter Company Name",
Title:="Prize Draw", Type:=2)
If VarType(CoName) = vbBoolean Then
If CoName = False Then
Debug.Print "cancelled"
Exit Sub
End If
End If

LastRow = .Cells(Rows.Count, "A").End(xlUp).Row + 1
.Cells(LastRow, 1).Value = UID
.Cells(LastRow, 2).Value = EntrantName
.Cells(LastRow, 3).Value = CoName
.Cells(LastRow, 4).Value = Format(Date, "dd/mm/yyyy")
.Cells(LastRow, 5).Value = Format(Time, "HH:MM:SS")

End If
End With
End Sub

--
JB


"S Swedowski" wrote:

I am a intermediate user of Excel. I don't know if this is possible but this
is what I would like to do. I am going to a trade show that particpants will
come to our booth and be able to register for a prize. They will only be
able to enter once. But over the course of the 3 day show, people come back
2 or even 3 times. So is it possible to have a form/box that would I can:

1. enter a unique identifer # into and then a search would look for a
duplicate.
2. if duplicate is found, would show the duplicate information.
3. if no duplicate is found, the cursor would go to the next empty record
and be ready for the input of the new information.

If you need more information in order to help me, please email me at


Thank you!!

 
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
First Input on a Form JayW Excel Worksheet Functions 0 June 13th 07 09:33 AM
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
How can I have an input form to add a random no. to each input entry? saziz Excel Discussion (Misc queries) 2 January 25th 06 11:46 PM
input form G[_5_] Excel Programming 1 January 19th 04 07:55 PM
Input box/form acsell Excel Programming 11 October 9th 03 11:22 AM


All times are GMT +1. The time now is 08:18 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"