Macro help

Dan Wilson

Well-known Member
Joined
Feb 5, 2006
Messages
507
Office Version
  1. 365
Platform
  1. Windows
Good day. I am running Excel out of Office365 (updated) and Windows 10 Home (updated). I have a worksheet titles "50-69" with 16 Columns and 4,000 Rows. I have created Macros to sort this worksheet in several different ways. To make the job easier, I have moved the Control Buttons that run the Macros to another worksheet titled "Macros" that houses the Control Buttons and a description of what each Macro does. All is working well with one problem. The last line of code in each Macro is "Range("I2").Select" with different cells in the worksheet "50-69" chosen as the Select. Is there a line of code that I can use in the Macros to make the display show the newly sorted data instead of remaining in the "Macros" worksheet? Thank you for any help with this.
Dan Wilson...
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Good day. I am running Excel out of Office365 (updated) and Windows 10 Home (updated). I have a worksheet titles "50-69" with 16 Columns and 4,000 Rows. I have created Macros to sort this worksheet in several different ways. To make the job easier, I have moved the Control Buttons that run the Macros to another worksheet titled "Macros" that houses the Control Buttons and a description of what each Macro does. All is working well with one problem. The last line of code in each Macro is "Range("I2").Select" with different cells in the worksheet "50-69" chosen as the Select. Is there a line of code that I can use in the Macros to make the display show the newly sorted data instead of remaining in the "Macros" worksheet? Thank you for any help with this.
Dan Wilson...
worksheet("50-69").activate will display the worksheet with the data on it.

Range("I2").Select will select that cell on the active workbook, Macros.
 
Upvote 0
Good day Herakles and thank you for responding so quickly. After some experimentation, I was able to make your suggestion work. I think I understand Macro structure a little better now.
Thanks, Dan Wilson...
 
Upvote 0
Or you can try
VBA Code:
Application.Goto WorkSheets("50-69").Range("I2"), True
 
Upvote 0
Solution
Good day MARK858 and THANK YOU for the answer that not only works, but it also fixed another problem with two of my seven Macros. And thank you for sending the suggestion even after I marked the post as completed.
Dan Wilson
 
Upvote 0
You're welcome, it was just another option to consider.
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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