Ideas into Practice

  • Thread starter Thread starter Robert Couchman
  • Start date Start date
R

Robert Couchman

Hello all and good morning!

can anyone please help me develop my idea as im not sure
the best way around this

*Back ground*
i have 135 people apply for a test, but i sort these
people to those that pass/fail, and highest score.
i only have testing room for a maximum of 100 people
though.

*Idea*
in my program i would like a piece of macro that would go
through the list, and if they are still classed as passed
it will give them a test date and time

*Problem*
room size will depend on location so i may have to test
the 100 people over 3 days, is there anyway of making the
program look at textboxes that i type a date, time, number
of people it will seat. and then work through the first
number of people it will seat putting in there date and
time, then procede to the next box and for the next
seating number put in the date and time.. etc.

thank you,

Robert Couchman
([email protected])
 
Robert,

Here is some code based upon textboxes on a form. I have managed the first 3
textboxes, I will leave it to you to extend

Private Sub CommandButton1_Click()
Dim iStart As Long
Dim iEnd As Long
Dim i As Long

With TextBox1
If Not IsDate(.Text) Then
.SelStart = 1
.SelLength = Len(.Text)
.SetFocus
Exit Sub
End If
End With

With TextBox2
If Not IsDate(.Text) Then
.SelStart = 1
.SelLength = Len(.Text)
.SetFocus
Exit Sub
End If
End With

With TextBox3
If Not IsNumeric(.Text) Then
.SelStart = 1
.SelLength = Len(.Text)
.SetFocus
Exit Sub
End If
End With

With Worksheets("Sheet1")
iEnd = CLng(TextBox3.Text)
For i = iStart To iEnd
.Cells(i, "B").Value = TextBox1.Text
.Cells(i, "C").Value = TextBox2.Text
Next i
End With

iStart = iEnd 'ready for next set of textboxes
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thank you Bob,

but i am not sure how to use this code, please can you
explain what it does, and then i will try and see where to
use it in my program.

sorry bob,

Thank you,

Robert Couchman
([email protected])
 
I am assuming that you will build a userform to input the data. This code is
designed to be fired from a commandbutton on the userform after the data has
been input.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Similar Threads

Back to the brick wall!! 1
Textbox problem 11
Seating Chart 8
looking for values 3
counting cells 2
IF... change colour 4
Excel 2010: Assigning another cell's value to a checkmark 0
Morning 1

Back
Top