Macro to get a shape to move around the Sheet so it is always on show.

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

I have a sheet Names "Test1"

In it I have lots of data.

Column C Is Blank and 30 Wide.

I have a shape "Square1" that is the same width as Column C and 10 Rows Height.

The first 5 rows are fixed using freeze rows.

The Square sits in Row 10 of column C.

The problem is as I scroll down the page the shape is scrolled out of view.

I was wondering if there is a macro that can make this shape stay visiable on the page?

Please help if you can.

Thanks

Tony
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Re: Macro to get a shap to move arond the Sheet so it is always on show.

Have you considered using a modeless userform for this instead of a shape ?
 
Upvote 0
Re: Macro to get a shap to move arond the Sheet so it is always on show.

Try this:
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

This script will run when you select any cell


Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Modified  8/20/2018  10:47:20 AM  EDT
Shapes("Square1").Top = ActiveCell.Top
Shapes("Square1").Left = ActiveCell.Offset(, 3).Left
End Sub
 
Last edited:
Upvote 0
Re: Macro to get a shap to move arond the Sheet so it is always on show.

HI The Answer is, This is a good Idea, Think I can make it work, thanks Tony
 
Upvote 0
Re: Macro to get a shap to move arond the Sheet so it is always on show.

Glad I was able to help you.
Come back here to Mr. Excel next time you need additional assistance.
HI The Answer is, This is a good Idea, Think I can make it work, thanks Tony
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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