Thread: Mileage Chart
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
stevebriz stevebriz is offline
external usenet poster
 
Posts: 195
Default Mileage Chart


Tony,
something along the lines of this should work for you

Create a userfrom with 2 text boxes, 1 commandbutton and 1 label and
also a close buttom
Add command button to you spreadsheet to open the user form

On the spreadsheet
Enter all the zip codes in row starting a column B
Enter all the zip codes in column 1 starting a row
Fill in all the appropriate mileages


Then in the commandbutton1_click ( your enter or get mileage button)
Code the following

Dim I as integer
Dim J as integer
i = val(textbox1.value) - 23318

J = val(textbox2.value) - 23318
Label1.caption = cells(I,J).value

You might want to put some error checking to ensure the textbox entry
is numeric and also in the range of the Zip codes. ( this will prevent
errors coming up)

Any questions?..let me know.