PDA

View Full Version : Solved: Copy vlookup in Form



Emoncada
02-19-2008, 09:54 AM
I have 54 txtboxes in one row TxtTrack1 - TxtTrack54 some are not visible unless clicking a button to make them visible. I added a button next to the first txtbox.

What I would like for it to do is after or during data is being entered in txtTrack1 for it to look at the range of CmboxDesc1 - CmbBoxDesc54. value and enter to match same cells.

Let me explain.

So if CmbBoxDesc1 - CmbBoxDesc25 has a value then
TxtTrack1 - TxtTrack25 should all have the same value that is entered in TxtTrack1. Either when entered or after TxtTrack1 is entered have the user click the button for it to paste that value into those txtboxes.

Hope that explains my goal.

Bob Phillips
02-19-2008, 10:50 AM
Private Sub TxtTrack1_AfterUpdate()
Dim i As Long

With Me

For i = 2 To 25

If .Controls("CmbBoxDesc" & i).Value <> "" Then

.Controls("TxtTrack" & i).Text = .TxtTrack1.Text
End If
Next i
End With
End Sub

Emoncada
02-19-2008, 10:53 AM
Perfect XLD that works great thanks a ton.