I have trying to auto fill textboxes based on the ComboBox selection, but I keep getting a "Run time error 9, subscript out of range" Can't find the issue with the code, see below.
Please Login or Register to view this content.
I have trying to auto fill textboxes based on the ComboBox selection, but I keep getting a "Run time error 9, subscript out of range" Can't find the issue with the code, see below.
Please Login or Register to view this content.
Last edited by am9293; 01-09-2019 at 03:46 PM.
A few things
1) It would help if you told us which line of code was failing.
2) Your quotes are wrong they should be " not the sloping quotes you have used.
3) Do you have a sheet called Sheet4?
4) In you combo change event you are using ws.Cells, but have not assigned anything to it.
I get a error message box, it doesn't highlight which line of code is failing.
Fixed the quotes, still same error
Yes, to Sheet4
I found and modified this code from another site online, so not sure how to assign.
So I ran my setup from the beginning and it shows the following error...
error.jpg
In the VB editor select Tools > options > General > select "Break in class module" > Ok
The try running the code again
The error now shows as
Set ws = Sheets("Sheet4")
error2.jpg
In that case you don't have a sheet called sheet4.
Are you looking at the name on the sheet tab, or the name shown in the Editor like Sheet4(Something)
You also still have incorrect quotes
Oh geez, ok that was simple fix.....duh...
But now, when the UserForm runs, by TextBoxes don't get filled in....
Trywhere the line in blue is at the very top of the module, before any code.Please Login or Register to view this content.
Also please edit you original post to include code tags, the #icon in the reply/edit window.
Ok, added your suggested code, Userform works, but TextBoxes do not autofill when I select an option from the ComboBox
Please Login or Register to view this content.
How aboutPlease Login or Register to view this content.
I got it, thanks for your help
You're welcome & thanks for the feedback
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks