PDA

View Full Version : VBA Navigation within tables



joshua1990
06-28-2017, 06:45 AM
Hey guys!
I'm just going to optimize my excel workbook a bit. For this I am mainly lacking an approach for navigation within the tables. A kind of floating button, which is fix and gives me the link to another table. Or a separate symbol / navigation bar.

Does someone have perhaps one or the other idea?


Best regards
Joshua

mdmackillop
06-28-2017, 07:44 AM
How about a userform



Private Sub UserForm_Activate()
Dim ws, t
For Each ws In Worksheets
For Each t In ws.ListObjects
ListBox1.AddItem t.Name
Next t
Next ws
End Sub


Private Sub ListBox1_Click()
Dim x, y, Tbl
Set Tbl = Application.Range(ListBox1).ListObject
x = Tbl.Range.Rows.Count
y = Tbl.Range.Columns.Count
Application.Goto Tbl.Range.Cells(x, y)
End Sub

joshua1990
06-28-2017, 08:30 AM
Hello mdmackillop!
Thank you for your proposition. It is a very interesting approach which I will keep in the back of my head. However, this does not fit so completely. The navigation buttons or symbols should be fixed, so that you can navigate to the other pages for each view.

So it is more a fixed solution is searched, which comes with the scrolling.
It is, of course, possible to put buttons in the first line, and then fix this line, but I am looking for a more elegant alternative (:

mdmackillop
06-28-2017, 09:28 AM
The above code will navigate to tables on any sheet.
Perhaps you can mock up a representation of what you are after, then we can look at the coding.

joshua1990
06-28-2017, 10:58 AM
Many thanks for your response.

Here is a screenshot.
1961719618
I need somewhere a button or a field, which shows me the individual tablesheets. So I would like to switch through the leaves, respectively, to the top position.

It is possible to fix the first line, to put the button there and to link it with the corresponding tables, but I am looking for an alternative.

mdmackillop
06-28-2017, 11:46 AM
Is that not the purpose of the tabs? if you're looking for more, can you be more specific?

joshua1990
06-28-2017, 11:51 AM
This is true, I need the function of the tabs, but within the table. A kind of button or similar, which scrolls with the scroll always.Ob Userform, MsgBox or anything else, now does not matter (:If you have several ideas for this, we can gladly look which is best (: