Starkey
Board Regular
- Joined
- May 5, 2006
- Messages
- 187
Hi all. Random question I hope you can help me with please
I've built an app whereby a user clicks on a button on Sheet1 and a userform pops up. The userform contains a menu of options. Certain options are only available to that user once they update a particular table (worksheet). They do this by copying the results of an SQL query in to the worksheet. The process is:
- User opens the userform by clicking a button on Sheet1
- User clicks on an option from the userform menu
- Msgbox pops up informing user to run a query and copy the results in to a table first
- Userform automatically unloads (Unload Userform28)
- User is taken to the table (worksheet):
Sheets("Brands").Select
Range("A1").Select
- User runs the query in SQL and copies the results in to the clipboard (CTRL-C)
- User then pastes the results in the worksheet "Brands" (CTRL-V)
However the issue is that the results actually get copied on to Sheet1 (the sheet with the button that opens userform28) and not the visible sheet ("Brands")
Completely puzzling me - screenupdating is off. The worksheets are all visible. I added a further line of code (Worksheets("Brands").Activate) but that had no effect
Any help would be much appreciated
I've built an app whereby a user clicks on a button on Sheet1 and a userform pops up. The userform contains a menu of options. Certain options are only available to that user once they update a particular table (worksheet). They do this by copying the results of an SQL query in to the worksheet. The process is:
- User opens the userform by clicking a button on Sheet1
- User clicks on an option from the userform menu
- Msgbox pops up informing user to run a query and copy the results in to a table first
- Userform automatically unloads (Unload Userform28)
- User is taken to the table (worksheet):
Sheets("Brands").Select
Range("A1").Select
- User runs the query in SQL and copies the results in to the clipboard (CTRL-C)
- User then pastes the results in the worksheet "Brands" (CTRL-V)
However the issue is that the results actually get copied on to Sheet1 (the sheet with the button that opens userform28) and not the visible sheet ("Brands")
Completely puzzling me - screenupdating is off. The worksheets are all visible. I added a further line of code (Worksheets("Brands").Activate) but that had no effect
Any help would be much appreciated