Inserting pictures in a spreadsheet.

Posted on 2011-05-05
Last Modified: 2012-05-11

I set in a macro a column width : ws.Columns(lngCol).ColumnWidth = Range("kWb")
Range("kWb") is in my parameters is 42,57 and my column width will be set to about 6,5 cm or 2.6 inch. This is OK.
But when I use the same instruction “ws.Columns(lngCol).ColumnWidth - 5” in another macro then he set the picture on the left site in the cell (about 1,5cm or 0.6 inch from the left).
I’am confused, I only want to place several pictures along each other in a cell.
e.g. pic1 : left 10 / width 5
       pic2 : left 15 / width 8
       pic3 : left 23 / width 6

Question by:sonmic
    LVL 6

    Expert Comment

    by:Eric Zwiekhorst
    This is due to the fact that pictures are not directly linked to the cell you try to put them in.


    Author Comment

    How can I solve it?
    LVL 43

    Accepted Solution

    I am not sure I am fully with you but you can try something like

    ws.Columns(lngCol).left +ws.Columns(lngCol).ColumnWidth - 5

    If this does not solve your problem then upload your code and we shall try to assist.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
    This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now