Validation ?

D

David W

Got a Question
I have got 12 columns and 160 rows
I need to use an input box in each cell so you will know what cell your in,
know here's the trick
I know that I can use validation to do this by copying and doing a paste
special, BUT how do you get the contents of the message to grow by one
Example
if A1 had validation and it read
"Truck 1"
"Enter Gallons"
how could you get it to change to
"Truck 2"
"Enter Gallons" in A2 ;and so on
This one is a little tricky for me
 
D

Don Guillett

Could you use an input box
or just a table
truck gallons
1
2
and enter without being fancy
 
D

David W

Using a Table
If you used a table your not going to know what column your in when you get
further down in the sheet,(unless your talking about something else that I
am not aware of)

What kinda input box are you refering to.
It needs to pop up automaticlly so everbody wont be sitting down for 2 hours
entering data,
its purpose in life is to make me miserable, but to make data entry faster
 
D

Debra Dalgleish

You could freeze the headings, so they will remain visible as you scroll
through the worksheet. For example, if your headings are in row 1 and
column A, select cell B2, and choose Window>Freeze Panes.

This will freeze the cells above, and to the left of the selected cell.
 
S

steve

David,

You could use an "event macro".

Copy and paste the below macro into the module for your entry worksheet.
I have made the assumption that row 1 contains the type of vehicle.
If this is incorrect - you can set hdr = "xxxx"

You could also use the same idea in a standard macro module and
use a loop to add validation to all the cells.

hth...

steve

======================================================
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim hdr As String, x As Long
'
hdr = Cells(1, Target.Column)
x = Target.Row
If Len(hdr) > 0 Then
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = hdr & " " & x & Chr(10) & "Enter Gallons"
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
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

Similar Threads

best way to validate data in forms; 2010 1
A data validation question 1
If formula and Data Validation parallely 1
Mileage Query 1
VBA Macro 2
Data Validation 2
IF Statement 6
Data Validation blanks for formulas 18

Top