Userform and Index

jmacritz

New Member
Joined
May 9, 2019
Messages
10
I have a sheet that shows the results of data looked up in a table using the formula
=IFERROR(INDEX(Sheet5!$A$2:$A$37,AGGREGATE(15,6,((ROW(Sheet5!$B$2:$B$37)-ROW(Sheet5!$B$2)+1))/((Sheet5!$B$2:$B$37=$B$3)),ROWS($A$1:A1))),"")

Sheet5 contains a table that has A)Room, B)Person, C)Date, D)Supplies. So essentially the formula is matching a user inputted Person and listing all the rooms they have booked. The formula works great so that's not an issue. What I'm having trouble with is my userform. I created a userform to allow people to enter in their bookings and update the table in sheet5 and it works fine to add the new records. However the Table is now 52 rows of data but my formula doesn't update to 52, it stays at 37. If I manually insert a row in the table the formula auto updates. How can I get the Userform to do the same thing?

The userform finds the first empty row in sheet5 and adds the values from the boxes to the row .Cells(row, 1).Value = Me.Roominput.Value so on and so forth
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
After extensive searching I found the answer myself. For anyone with a similar problem, adding the code

worksheet.Rows(row#).Insert

will add a row to your table at and auto update the formula.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top