macro to resize shape to size of rows with text in it

tonywatsonhelp

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

I have a shape Called "View1"

all i want is a macro that will increase or reduce its size according to the data in the column it surrounds

So the shape is placed around data in column C (the width if fine,

My rows are all set at height of 15
Data starts in Row 16

so i want a macro that checks how many rows in coulmn C16 down have data in them and increase the shape by that many rows or reduce it
so lets say shapes default height is 40, then if each row increases the size by 15 then it 40 + 15*number of rows

please help if you can

Thanks
Tony
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Strictly speaking, what you need is a worksheet level event procedure, not a macro.

You need to explain a couple items for someone to offer a solution to fit your workbook design.
(1)
How does the data from cell C16 downward get into those cells. Formulas in column C? Manual entry? Copy and paste? Imported from an external source?
(2)
Are cells in that column multi-edited, meaning is only one cell at a time changed, or can many cells in that range be changed.
(3)
Are any cells merged.
(4)
Are any cells formatted for wrapped text.

Keep in mind that no one reading this except you has ever seen your workbook. You did well to specify where the range of interest starts in cell C16 and where theoretically the range would end. Just describe a bit more about what you are working with, with those 4 items in mind, at least as a start to get a reply you can use.
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

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