Harsh sharma
Banned - Rule violations
- Joined
- Aug 1, 2020
- Messages
- 11
- Office Version
- 2019
- Platform
- Windows
Please help me.I have a userform in which i have to search data with date and customer name in text box1 and textbox2 then the data of same row loads on other textboxes but there is rows below the search data in column A there is date + customer name which i also have to search and show the data in listbox of there rows you can look at code below for example
First row is 20.02.20,harsh sharma ,1800 rs etc
Second rows which i want in listbox is 20.02.20Harsh sharma,vegetable name 1
20.02.20Harsh sharma, vegetable name 2
Again another customer name and date
First row is 21.02.20,naman sharma,200rs
Second rows which i want in listbox is
21.02.20naman sharma,vegetable name 1
21.02.20naman sharma,vegetable name 2
Dim x as long , y as long ,w as string
X= sheet6.cells("A").rows.count.xlup.end
Y = 3 to x
If me.textbox1.value = sheet6.cells(y,1).value and me.textbox2.value = sheet6.cells(y,2).value then
Me.textbox3.value = sheet6.cells(y,3).value
Me.textbox4.value = sheet6.cells(y,4).value
Me.textbox5.value = sheet6.cells(y,5).value
w = me.textbox1.value + me.textbox2.value
If w = sheet6.cells(y,1).value then
Me.Listbox1.additem sheet6.cells(y,3).value
End if
End if
Next y
End sub
Thanks in advance i need it very much whoever the person is reading may god bless you you don't know how much it can help mw
First row is 20.02.20,harsh sharma ,1800 rs etc
Second rows which i want in listbox is 20.02.20Harsh sharma,vegetable name 1
20.02.20Harsh sharma, vegetable name 2
Again another customer name and date
First row is 21.02.20,naman sharma,200rs
Second rows which i want in listbox is
21.02.20naman sharma,vegetable name 1
21.02.20naman sharma,vegetable name 2
Dim x as long , y as long ,w as string
X= sheet6.cells("A").rows.count.xlup.end
Y = 3 to x
If me.textbox1.value = sheet6.cells(y,1).value and me.textbox2.value = sheet6.cells(y,2).value then
Me.textbox3.value = sheet6.cells(y,3).value
Me.textbox4.value = sheet6.cells(y,4).value
Me.textbox5.value = sheet6.cells(y,5).value
w = me.textbox1.value + me.textbox2.value
If w = sheet6.cells(y,1).value then
Me.Listbox1.additem sheet6.cells(y,3).value
End if
End if
Next y
End sub
Thanks in advance i need it very much whoever the person is reading may god bless you you don't know how much it can help mw