Results 1 to 8 of 8

Moving Shape Down on Laptop Monitor Unsuccessful

Threaded View

wiitguru Moving Shape Down on Laptop... 03-17-2022, 01:19 PM
TMS Re: Moving Shape Down on... 03-17-2022, 01:23 PM
wiitguru Re: Moving Shape Down on... 03-17-2022, 01:45 PM
wiitguru Re: Moving Shape Down on... 03-17-2022, 03:49 PM
TMS Re: Moving Shape Down on... 03-17-2022, 04:01 PM
wiitguru Re: Moving Shape Down on... 03-17-2022, 04:51 PM
TMS Re: Moving Shape Down on... 03-17-2022, 04:54 PM
wiitguru Re: Moving Shape Down on... 03-21-2022, 02:40 PM
  1. #1
    Registered User
    Join Date
    02-24-2022
    Location
    Ozaukee County, Wisconsin, USA
    MS-Off Ver
    Office 365 and Office 2013
    Posts
    19

    Question Moving Shape Down on Laptop Monitor Unsuccessful

    Dear Forum,

    I am trying to move a shape down one row on a worksheet. When I use the following code to do so on an external monitor that is attached to my laptop, the process works perfectly. If, however, I move the Excel workbook to my laptop's screen and try to perform the same operation, it errors out almost every time. Also, if I close the workbook, disconnect the external monitor, and re-open the workbook on my laptop, the same problem occurs.

    By "erroring out", I mean that the shape is not placed down to the new row correctly, and code following the placement fails to execute. The shape appears halfway or so down to the new row, and all of the other dimensions seem to be set correctly. It's just not "down" in the right place.

    Does anyone have any insight on this? I'm running Office 365 on a Windows 10 HP EliteBook laptop.

    Option Explicit
    Option Compare Text
    
    Public Sub MoveMyShape(wksName As String, oShapeName As String)
    
        Dim wb As Workbook
        Dim wks As Worksheet
        Dim oShape As Shape
        Dim oShapeRow As Long
        Dim oShapeColLong As Long
        Dim nextRow As Long
    
        Set wb = ThisWorkbook
        Set wks = wb.Sheets(wksName)
        Set oShape = wks.Shapes(oShapeName)
        oShapeRow = oShape.TopLeftCell.Row
        oShapeColLong = oShape.TopLeftCell.Column
        nextRow = oShapeRow + 1
        
        oShape.Top = wks.Cells(nextRow, oShapeColLong).Top
        oShape.Left = wks.Cells(nextRow, oShapeColLong).Left
        oShape.Width = wks.Cells(nextRow, oShapeColLong).Width
        oShape.Height = wks.Cells(nextRow, oShapeColLong).Height
    
    End Sub
    Brian
    Last edited by wiitguru; 03-17-2022 at 01:41 PM. Reason: Missed one line of code.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 10-17-2017, 10:36 PM
  2. Moving Byproduct of View>New Window to Second Monitor
    By sbeatty in forum Excel General
    Replies: 3
    Last Post: 03-19-2017, 07:53 AM
  3. Moving Shape with Cursor
    By sswcharlie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2015, 05:06 PM
  4. Move Office 365 from Old Laptop to New laptop
    By claudiahacks in forum Office 365
    Replies: 0
    Last Post: 09-09-2013, 04:33 AM
  5. shape moving with cells
    By gingko in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2013, 05:48 PM
  6. moving duplicate shape
    By kramer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-13-2007, 03:14 PM
  7. [SOLVED] shape of cursor does not change over command button on second monitor
    By Herb Meier in forum Excel General
    Replies: 2
    Last Post: 06-02-2005, 02:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1