Hi,
Difficult to say without seeing the request in context but try changing the .value property to .listindex
Hi,
Difficult to say without seeing the request in context but try changing the .value property to .listindex
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
No fluff code version with explanations:
![]()
Private Sub btnViewVendor_Click() Dim ventu As Range, rven As Long Set ventu = Worksheets("Vendors").Range("VendorList") rven = ventu.Rows.Count With ventu Set ventu = ventu.Resize(rven, 1).Offset(1, 0): ventu.Name = "Vendor" End With '####NONE OF THAT CODE ABOVE SHOULD HAVE ANY BEARING ON THE CODE BELOW '####I CAN JUST AS EASILY MAKE RVEN = Worksheets("Vendors").Range("VendorList").Rows.Count AND STILL GET THE VALUE OF 29. '####VENDORLIST IS A NAMED RANGE ON THE SHEET VENDOR. SpinButton1.Value = rven '####ERROR HERE#### '####THIS CODE BELOW IS IRRELEVANT TO THE PROBLEM. I CAN COMMENT IT OUT AND WILL STILL GET THE ERROR ListBox1.ListIndex = SpinButton1.Value - 1 txtVendorName.Value = ListBox1.Value End Sub
EDIT: Ahh, the little things... I had set a listbox1.listindex to spinbutton1.value on form initialize, so when the value of the spinner was over the listbox it was tied to, the listbox was actually causing the error to the spinner which was causing the error in that section of the code.Looks like problem solved.
Last edited by Taemex; 12-19-2014 at 07:52 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks