Okay, so I literally started using VB in excel last week, and am trying to put together multiple userforms that perform separate tasks. I have been using code found on this forum, and it's helped out a lot, but i'm still having trouble on one of the userforms. the one that i'm having the biggest trouble with called frmEditData. What it is designed to do is pull data from different fields and display them in the textboxes on the different sheets. then, the user has the option of updating those tabs and saving the changes. For the life of me, i cannot get the data to change. it always reverts back to the original information in the cells.
i have to say again that I don't really know how to read the code too well just yet, and i've been copying code that appears to work on other sheets, but it might not necessarily work here. I have attached a rough copy of what i've been working on. thanks in advance for your help
Last edited by rylo; 02-01-2010 at 05:48 PM.
Hi
What data is supposed to be going into the listbox when the form loads?
rylo
as of right now it's supposed to be pulling column A (last name), but i want it to pull column 4 (claim number)
also, the user form that i'm having trouble with seems to work on my home computer when i'm working on it from here, but will not work when i'm at work, which is what's it's being created for.
Hi
The formula for the defined name FirstField has an error in the example file.
How about you correct that, rebase it on column D as required, and update the example file.
I did a quick hack around, and it updated the Firstname when that formula was altered.
rylo
You gotta forgive me, I'm REALLY new at this and do not have anyone at work to learn from. i don't know where the error is occurring from, or how to rebase the Firstfield on Column D instead of A. It seems when i created another test file using the same coding it works, but when i open the test file that I posted up previously, it gives me run-time error ‘380’ – Could not set the RowSource property. Invalid property value”, which is probably the error that you received, but the coding was not changed. I have changed the coding, as shown below, but it doesn't seem to change where the rowsource data is being pulled from on the listbox. To me, it looks like the code is reading like this:
in userform, the data source for listbox1 is coming from A2-G, pulling from Row D specifically
frmEditData Listbox1 shows this data labeled as FirstField.
Is that right?
Again, thanks for your help, and forgive my incompetence in all of this, I'm really trying to learn.Code:Private Sub UserForm_Initialize() 'UserForm1.listBox1.RowSource = "A2:G" & Cells(Rows.Count, "D").End(xlUp).Row frmEditData.ListBox1.RowSource = "FirstField" End Sub
Hi
I've updated your example file and the edit seems to be working now.
rylo
Thanks!! It works perfect now!!![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks