+ Reply to Thread
Results 1 to 5 of 5

Simplifying Code

  1. #1
    Registered User
    Join Date
    06-06-2016
    Location
    London
    MS-Off Ver
    2010
    Posts
    50

    Simplifying Code

    I found this bit of code online and i adjusted to fit my program. Basically it inserts an image into a worksheets specified cells(name range) and centers it in the middle. However I am trying to simplify it, can anyone help?

    There are 10 images, all with different names.

    Please Login or Register  to view this content.
    Code is repeated for 10 images. Note: There may be some images missing and I noticed that if there is...the image will go on the wrong location.

    Appreciate any helps

    Thanks

  2. #2
    Registered User
    Join Date
    11-18-2014
    Location
    australia
    MS-Off Ver
    2015
    Posts
    43

    Re: Simplifying Code

    turn the code into a function, and pass the
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    to the function each time.

    as for whether the image exists, you could just check for it first

    Please Login or Register  to view this content.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Simplifying Code

    Or:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    06-06-2016
    Location
    London
    MS-Off Ver
    2010
    Posts
    50

    Re: Simplifying Code

    the code above doesn't seem to work, it doesn't insert any images.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Simplifying Code

    It ought to be the same as your old code

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

+ 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. simplifying Code
    By thanny88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2017, 12:35 PM
  2. Simplifying the code
    By cretzull in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-20-2016, 03:54 AM
  3. Simplifying code
    By cg0789 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2012, 05:28 PM
  4. Need help simplifying a code Please
    By Lostinexcel2002 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-10-2008, 07:54 PM
  5. Simplifying the Code
    By marino72 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2008, 06:40 PM
  6. Simplifying the code
    By walid66 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-20-2008, 07:53 PM
  7. Simplifying VB code
    By odggi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-30-2006, 07:09 AM

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