Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As far as I could tell from your email this is what you
were wanting. There was some guessing so it might be wrong. Instead of having the information separated amongst the different textboxes you might be better off just using one large textbox and constructing a complex string (using vbLf to create line change). You would thus read the info like a report in this large textbox. Alternatively, use labels perhaps. Just throwing out some ideas. Note that, for my tests, I added more textboxes to the UF so that there was a total of 18 "txtdes" type (i.e. "txtdes1" to "txtdex18") corresponding with the 18 Attribute cells. You should do this to test the code. Hope my interpretation was correct. Private Sub CommandButton1_Click() Dim WS As Worksheet Dim C As Range, CC As Range Dim i As Integer, ii As Integer Dim x As Integer On Error Resume Next Set WS = Sheets("Blad1") Set C = WS.Range("A:A").Find(txtcode.Value) i = 0: ii = 0: x = 0 For i = 2 To 18 Step 8 For ii = 1 To 2 Set CC = WS.Cells(C.Row, i + ii) Controls("TextBox" & x * 2 + ii) = CC Next ii For ii = 3 To 8 Set CC = WS.Cells(C.Row, i + ii) If Trim(CC) < "" Then x = x + 1 Controls("txtdes" & x) = CC End If Next ii Next i On Error GoTo 0 End Sub Regards, Greg -----Original Message----- Hello Greg, That would be very helpful, Where can I find your e-mail address? Thanks and best regards, gki --- Message posted from http://www.ExcelForum.com/ . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populating a userform 3 col listbox | Excel Programming | |||
Populating word document from userform inputs. | Excel Programming | |||
Populating Sheet Data From A UserForm Combo Box Enabled For Multi-Choices | Excel Programming | |||
Populating a VBA UserForm | Excel Programming | |||
Populating Textbox in UserForm | Excel Programming |