Hello,
Can there be VBA code to update Vehicle details from the Vehicle Expense Tracker sheet to the Vehicle List sheet?
I want the ability to edit details please.
Thank you kindly for your help
Hello,
Can there be VBA code to update Vehicle details from the Vehicle Expense Tracker sheet to the Vehicle List sheet?
I want the ability to edit details please.
Thank you kindly for your help
This will not work as the highlighted are merged cells: and I am sure you have been advised previously about NOT using merged cells.Please Login or Register to view this content.
The attached uses a TEXTBOX for the entry of the notes.
G1 in "Vehicle List" is set to blank to cater for the TEXTBOX addition:Please Login or Register to view this content.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
Thanks I don't want to add more vehicles but rather update details of a current vehicle. There are currently a maximum of 10 vehicles for this workbook which I want to maintain.
I appreciate the help and yes it is not good practice to have merged data cells.
I did mis-read your post as you said update so are you going have an UPDATE button in addition to ADD ?
Last edited by JohnTopley; 03-28-2024 at 06:04 AM.
To be fair, Billy mentioned BOTH in the opening post, and 'update' is also in the thread title.
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
It will be starting with no cars entered at first. These are just samples. Then the user can add up to 10 cars. I will have to adjust the row limits in the code.
What I had asked for (probably my poor explanation) was to edit details of any of the cars that exist.
I did notice that if there aren't any pictures for a car when navigating it goes to debug though.
Thank you
Yes there should be an update button sorry
@AliGW: yes, I apologised as I did mis-read the initial post.
So, are you going to use an UPDATE button as well as ADD?
And do you want a check on the car limit (of 10) ?
Yes please sir
..... how about DELETE of cars? And are there fields that can not be changed as (to me) the only variable is NOTES unless a car undergoes a change of specification.
I wonder if UPDATE really means CHANGE TO A DIFFERENT CAR?
Yes it does seem that the notes field would be a field that could change for perhaps a particular future issue detail. But maybe the user entered an incorrect plate number for instance?
Yes a delete of a car would be beneficial. The user may trade in a car so would have new car to enter.
See if this helps.
In the Vehicle_Macs module
Declare public variable and function
assign the variable during vehicle loadPlease Login or Register to view this content.
Please Login or Register to view this content.
Change the Save routine
In Sheet1 change eventPlease Login or Register to view this content.
Please Login or Register to view this content.
Thank you @ByteMarks.
I see that when changing a detail the SAVE button appears which is great!
I tried to enter a new vehicle when there are already 10 vehicles. Could there be an error check or perhaps the ADD button not showing when 10 vehicles are in the vehicle list?
With ByteMarks code I get an error when adding a new vehicle
Maybe this in the workbook open and then make the same assessment wherever you set it to true.
Please Login or Register to view this content.
Yes I also get error adding new vehicle.
Post #3Didn't look at that part yet. If it's limited to 10 you can't add more without first deleting some?I don't want to add more vehicles
Yes I put limit of rows to A13 so no additional rows could be added but I still get error.
So it would be a benefit to either warn the user that the maximum of 10 vehicles have been added or after 10 are in the list take away the add vehicle button (not show).
I think this should be
Please Login or Register to view this content.
My logic was that the "Add" button should only be visible if <10 cars so < row 13.
If < 14 then 10 cars are already populated in rows 4 to 13 so the button should be hidden.
What error you getting btw? I'm not getting any.
Under Save:
VehRow = .Range("B4")
oh yes. Change it to this.
Please Login or Register to view this content.
Could the Add button be hidden when max vehicles have been entered?
Last request thanks.
I should be from post #16
But wherever you previously set the button visibility to msoTrue, you need to assess the row count.
Please Login or Register to view this content.
It's still there even though 10 vehicles.
Does it work in this file?
Yes very good! Thank you so much for your fantastic help!
If I select another tab at top and come back to vehicles the Add button appears until I select a car then it disappears.
Last edited by billy60; 03-28-2024 at 08:01 AM.
You're welcome. Glad I could help.
I added Vehicle_Load
Please Login or Register to view this content.
Good call.
btw in the file I attached I did comment out Vehicle_AddPic and Vehicle_ShowPic, so you should uncomment those.
Yes I did that thanks. I realized that my file location for pics won't apply for you so it goes to error when there aren't any pics to find.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks