Has anyone got some example code to populate userform text fields from multiple sheets depending on which sheet has been selected?
I have a workbook with recipes on multiple sheets. The row and column data on each sheet are in the same location (i.e ingredient 1 = A1, ingredient 2 = A2, etc).
What I want to do is have a userform that pulls the data from the sheet when it is initialized, but the sheet is variable depending on which sheet the user wants to view.
For example: The user wants to view Recipe 1 which is on sheet1. When they click the Command Button for Recipe 1 the Userform opens with Sheet1 data. If they want to view Recipe 8, the userform opens with Sheet8 data.
I've set a cell to populate the sheet reference and then used this cell as a variable in the code but the sheet comes up blank. I'm in the VERY early stages of this project so haven't really got any code that is worth posting because this problem has stumped me already!
Hope you can help. Any example code will be most useful.