Database form
I'd suggest an approach like this:
Sub SetData()
Dim Idx As Integer
Dim DataRow As Range
Idx = Range("Idx").Value
Set DataRow = Range("Database").Rows(Idx)
Range("IDCell").Value = DataRow.Cells(1).Value
Range("CityCell").Value = DataRow.Cells(2).Value
Range("PaidCell").Value = DataRow.Cells(3).Value
End Sub
--
Jim
"Paul" wrote in message
...
| Newbie question:
|
| I am looking for the best way to fill in a form (in sheet 1) after the
| database has been done (in sheet 2). Don't want to use the Form feature
of
| Excel as I want to print and distribute the reports.
|
| My question is how I can fill in the cell of the form that i want from the
| database?
|
| Form:
|
| ID: 2
|
| Status: Done
| City: LA
| Paid: NO
|
|
| Database:
|
| ID Status City Paid
| 1 Done Kansas Yes
| 2 Done LA No
| 3 Working on Denver Yes
|
|
| Thanks for your help.
|
| Paul
|
|
|
|