populate listbox with columns values until empty column based on row value

gkisacik

New Member
Joined
Oct 29, 2018
Messages
24
Hi,

i have a database prepared where you can find added values from Column C onwards per Column A,

Column A = project numbers
Column B= project description

Column C = date
Column D = phase number
Column E = Member
Column F = Update

Column G = date
Column H= phase number
Column I =Member
Column J = Update
….



What I am trying to do is to populate listbox by searching project no listed on Column A. got basic code programme after searching on internet,

Code:
With lbupdate
.ColumnCount=4
.Additem
.Column(0, 0)=date??
.Column(1, 0)= phase number???
.Column(2,0)=Member??
.Column(3,0)=Update??
.Column(0,1)=date?
.Column(1,1)=phase number?
…..
….
End With
'must continue until empty column per row (project no)

Can someone please help me with a right code?

Thanks,

Gokhan
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Perhaps:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG06Nov14
[COLOR="Navy"]With[/COLOR] ListBox1
   .ColumnCount = ActiveSheet.Cells(1).CurrentRegion.Columns.Count
   .List = ActiveSheet.Cells(1).CurrentRegion.Value
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Thanks Mick,

Unfortunately it shows all the data on the listbox.

What i am trying to get an structured data when the second data repeated like in the example i have written in original query. listbox should take the data until the first "date" column empty. But that for one particular Project no listed on Column A.

It is a bit specific request i guess :)






Perhaps:-
Code:
[COLOR=Navy]Sub[/COLOR] MG06Nov14
[COLOR=Navy]With[/COLOR] ListBox1
   .ColumnCount = ActiveSheet.Cells(1).CurrentRegion.Columns.Count
   .List = ActiveSheet.Cells(1).CurrentRegion.Value
[COLOR=Navy]End[/COLOR] [COLOR=Navy]With[/COLOR]
[COLOR=Navy]End[/COLOR] [COLOR=Navy]Sub[/COLOR]
Regards Mick
 
Upvote 0
That is what i got so far...


Code:
Private Sub UserForm_Initialize()Dim n As Integer
Dim ws As Worksheet
Set ws = Worksheets("Updates")
ws.Activate
Dim FindString As String
Dim Rng As Range
With ws.Range("A:A")
Dim LName As String
Dim LNamei As Long


For i = 3 To 100
LNamei = WorksheetFunction.VLookup(txtprojectno.Value, Worksheets("Updates"), i, False)
Next i
If LNamei = "" Or " " Then




With lbupdate


  ' .ColumnCount = ActiveSheet.Cells(1).CurrentRegion.Columns.Count
  ' .List = ActiveSheet.Cells(1).CurrentRegion.Value
.ColumnCount = 4
.AddItem
.Column(0, 0) = LNamei ' This is not working like this way unfortunately..
.Column(1, 0) = LNamei+1
.Column(2, 0) = LNamei+2
.Column(3, 0) = LNamei+3
.Column(1,0)....
End With




'With Application
'.WindowState = xlMaximized
'Zoom = Int(.Width / Me.Width * 100)
'Width = .Width
'Height = .Height
'End With
End If
End With
End Sub
 
Upvote 0
If you could show an example of your data with an example of the expected results in listbox, it would help a lot !!!
 
Upvote 0
Hi,

I have prepared the file, unfortunately i cannot attach/post attachments according to the rules here.

perhaps i can send per email?

Cheers,
Gokhan

If you could show an example of your data with an example of the expected results in listbox, it would help a lot !!!
 
Upvote 0
Have a look here for posting Data,> Top left thread page> "Board FAQ" > "Guidelines for Forum Use"
Failing that you can post data using "Box.com" or "DropBox.com"
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top