+ Reply to Thread
Results 1 to 2 of 2

Problem with range statement

Hybrid View

martinbv Problem with range statement 06-24-2011, 02:45 PM
snb Re: Problem with range... 06-24-2011, 03:19 PM
  1. #1
    Registered User
    Join Date
    06-24-2011
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Problem with range statement

    I have a VBA routine that takes pictures from a database and displays them beside some relevant data. There are up to four images per display sheet.

    The routine works perfectly on my desktop machine and also on three other laptops but when transferred to another desktop the images appear on top of one another at a different location on the spreadsheet-they are all there and can manually be shifted to their correct locations.

    My machine runs Widnows 7 and I was using Excel 2010 to develop the package. The desktop which fails to position the pictures correctly is Windows 7 and Excel 2007. In this case the routine displays the images with C3 as the locating cell rather than Q1, Q13, Q25 and Q37. Every other aspect of the routines runs perfectly.

    For example in each case I use the following code to position and then insert the image;

    Range("Q37").Select
    temp2 = ThisWorkbook.Path & "\pictures\" & temp
    ActiveSheet.Pictures.Insert(temp2).Select
    Selection.ShapeRange.Height = 100

    I have also tried

    Range("Q37").Activate

    Thanks for any ideas on what is going on here.

    Brian

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Problem with range statement

    Ples use codetags around the VBA code

    You need to use 'Top' & 'Left' to position shapes .



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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