+ Reply to Thread
Results 1 to 5 of 5

.top .left for picture and cell don't match exactly

  1. #1
    Registered User
    Join Date
    01-25-2018
    Location
    london
    MS-Off Ver
    365
    Posts
    43

    .top .left for picture and cell don't match exactly

    Hi all, this is a bit of a weird situation. I've got some code that puts a number of images into column A, each image top left is aligned to top left of the cell. However, when i compare the positions of the cells to the images, some are a bit off.
    E.g. Most match but the ones in bold don't match and give oddly specific amount of decimal places:
    0 0
    310.5 310.5
    621 621
    931.5 931.5
    1242 1242
    1552.5 1552.5
    1863 1863
    2173.5 2173.5
    2484 2484
    2794.5 2794.500244
    3105 3105
    3415.5 3415.499756
    3726 3726
    4036.5 4036.500244

    Does anyone know why this is and maybe how to fix it?
    I've tried using VBA to move the one that is .top=2794.500244 to .top=2794.5 but when I check the position after moving it, it still shows .top=2794.500244
    I know its a ridiculously small increment but I'm trying to build a program that inserts the images exactly to the top left of the cells so that when they're uploaded to Google Sheets they are IN the cells and the .Top and .Left has to be exactly the same ( it has worked so far, but the ones that are just a bit off aren't in the cells when they're uploaded)

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: .top .left for picture and cell don't match exactly

    You need to get the cells .top and .left

    See sample

    https://www.youtube.com/watch?v=x2oKYHUfkNs

  3. #3
    Registered User
    Join Date
    01-25-2018
    Location
    london
    MS-Off Ver
    365
    Posts
    43
    Quote Originally Posted by davesexcel View Post
    You need to get the cells .top and .left

    See sample

    https://www.youtube.com/watch?v=x2oKYHUfkNs
    I did get the cells .top and .left and thats what i used to insert and place the image. The issue i have is that it isnt exactly the same for all the images. The left numbers in bold are where the .top is for the cell and the right number in bold is where the image .top has ended up, despite me using the cell .top to position the image.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: .top .left for picture and cell don't match exactly

    Don't use a number use the range.top

    .top=range.top

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: .top .left for picture and cell don't match exactly

    Re: "I've tried using VBA to move"
    Show us the code to import, position and move the pictures.
    The inherent weakness of the liberal society: a too rosy view of humanity.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] First Match & Return Cell to Left
    By djc123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-05-2021, 10:53 AM
  2. Replies: 10
    Last Post: 10-01-2019, 03:27 AM
  3. [SOLVED] Cell colour change to match that to its left
    By callummcgrath in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2017, 09:32 AM
  4. Replies: 5
    Last Post: 02-26-2017, 04:46 PM
  5. [SOLVED] How to move picture one cell left?
    By london7871 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-21-2016, 06:13 AM
  6. Picture rotation invalidates .Top and .Left
    By MadeOfAir in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2013, 08:23 AM
  7. [SOLVED] HOW TO: Move a picture to the top left or top right of a cell via
    By Kevin McCartney in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2006, 12:50 PM

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