UserForm to Go To column and row

Mack23

New Member
Joined
Aug 11, 2021
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I have very basic VBA skills and the current problem seems like a simple problem, but I am having trouble with this.
I am trying to use a userform to pop up for the operator, have them select two items from two listboxes (1 list is the column headers, 1 list is the row headers of a table) and then click a command button to take them to the column and row that they selected.

I have the Userform made with the listboxes populated and command button, just have to figure out the macro/code for the command button on the userform.

Any help would be appreciated, even a link to a previous thread as this seems like a problem that had to be talked about before.

Thanks,
Mack
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
So it seems the listbox items should correlate to the rows and columns you are looking for. (i.e. listbox item #3 would be row 4 assuming a header row in row one? If you have more rows on top or columns to the left of the listbox items you would have to adjust for this). The code you would be looking for would be something like

VBA Code:
Commandbutton1_Click()
...
Cells(listbox1.listindex + [number of rows from the top that are blank or not part of the row headers], listbox2.listindex + [number of columns from the left that are blank or not part of the column headers]).select
....
 
Upvote 0
Solution
Thank you, that works for what I need. I knew it was probably something basic. I may have other asks as the operators start to use this spreadsheet.

Thanks again.
 
Upvote 0
Happy to help. If you have other questions I'd be happy to assist. Just tag me in any new posting.
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,942
Members
449,094
Latest member
teemeren

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