I'm trying to make a database where i have two sheets, one to store the data, and the second to display some of that data in a sortable Excel Table. The reason I am doing this is so I can have a button which displays the next cell is a sequence of operations. I'm current doing this by deleting the referenced cell. (see image below) If there is a better way to achieve this functionality (in one sheet?), i would be very open to change. I have attached a copy of my workbook with confidential data removed.
\1
opexample.PNG
I added buttons in the last rows of the table to bring you to the correct row in the data storage sheet when clicked (one just selects it, one deletes a cell, and one deletes the entire row). Everything works fine until i reorder the table, or only display part of the table. When I change the order of the rows and click the GoTo button, it now brings me to whatever part was originally in that line.
\1
Parts Tracker.PNG
Screenshot of Excel Table
This is the code i am using to select the appropriate row in the data storage sheet.
Sub GotoRowButton()
' This sub controls the "Go To" button
' Offsets to a cell referencing the database, then follows that cell to the database row
Dim r As Range
Set r = ActiveSheet.Buttons(Application.Caller).TopLeftCell
Range(Cells(r.Row, r.Column), Cells(r.Row, r.Column)).Offset(0, -5).Select
With ActiveCell
.ShowPrecedents
.NavigateArrow True, 1
.ShowPrecedents True
End With
End Sub
I really appreciate your help on this problem. Hopefully there is a simple workaround, but i'm not experienced enough to come up with an alternative!
Bookmarks