Good Afternoon / Evening folks,
I have an excel / VB query I was looking for help with. I have been constructing an excel database, and have the following requirements.
a. One form for a user to fill out information, and insert into a blank excel row.
b. One form for a user to fill out, and insert information into blank fields but on an already existing row.
I have achieved "a" with the help of a tutorial from contextures.com (http://www.contextures.com/xlUserForm01.html), but am struggling with my second requirement.
The form itself is no problem, but I am having issues finding out how to do the following.
Insert the data from form "b" into the row where the value in column A equals a figure given in form b.
To further explain this, let me give an example. Form A is used when a stock item is purchased. Information such as purchase price and stock number are given, this is inserted into a blank row.
When an item is sold, form b is used. The user inserts the stock number into the form, and the other data such as sale price and sale date is inserted into a blank cell further along the row from the existing information filled in with form A.
The tutorial for finding the next blank row has given the following VB code to look it up:
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
Is there a way to alter this, or any other means of inserting data from form b into a row where column x == value y?
Best Regards