Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Is It Possible To Have A Shape Move Down A Sheet As A Table's Dynamic Range Expands?

Posted on 2013-06-12
5
Medium Priority
?
265 Views
Last Modified: 2013-06-12
I have a table in a spreadsheet. When you get to the last cell in the table, if you press 'tab' a new row is added to the table. I also have a shape below the table. As the table range increases, it eventually overtakes the shape and either is hidden by it or hides the shape, depending on the level of the layer. I have the shape set to be moved with cells, but unfortunately the table doesn't create a new row when it expands it's range - it just takes the next existing row and adds it to the table. I have googled this and can't find anything, which is weird because I feel like this isn't that outlandish of a request. I just want my shape to move down with my table so that they maintain the original layout as the table expands.  Is this possible?
0
Comment
Question by:Animaldrummer04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 1000 total points
ID: 39242040
Try using this in the sheet module for the worksheet you need "watched":


Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim tbl As ListObject
    Dim shp As Shape
    Dim TblLastRow As Long
    
    Set tbl = Me.ListObjects("MyTable") 'rename as needed
    Set shp = Me.Shapes("Fred") 'rename as needed
    
    With tbl
        TblLastRow = .Range.Rows(.Range.Rows.Count).Row
    End With
    
    With Me.Rows(TblLastRow)
        shp.Top = .Top + .Height + 10 'or use more or less space to separate them
    End With
    
End Sub

Open in new window

0
 

Author Comment

by:Animaldrummer04
ID: 39242408
Thank you for that, that does work. However, is there a way to get the shape to move down as soon as the new row is created? As it is written, the code uses the last row with data in the table, so when a new row is created the table doesn't move until something is typed into that row. And is the only way to do this with VBA/macro?
0
 

Author Comment

by:Animaldrummer04
ID: 39242425
I attached the workbook i tested the solution out with, if that's helpful.
test.xlsm
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 39242512
>>is there a way to get the shape to move down as soon as the new row is created?

No

>>And is the only way to do this with VBA/macro?

Yes
0
 

Author Closing Comment

by:Animaldrummer04
ID: 39242708
Thanks! Not exactly what i was looking for, but it seems as if what i was looking for is impossible.
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question