Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8302323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:15:40+00:00 2026-06-08T17:15:40+00:00

I have a workbook that has 54 sheets. Master Totals and Week1 through Week52

  • 0

I have a workbook that has 54 sheets. “Master” Totals” and “Week1” through “Week52”

I am trying to insert an image from a file to a cell on the sheets “Week1” through to “Week52”.

I have tried many codes and am able to get the image placed and sized correctly

the codes below both placed the image and I was able to manipulate them to get the image in the right spot and the right size.

I can’t however make them run through the other sheets (Week1 through Week52)

Set oPic = Application.ActiveSheet.Shapes.AddPicture("C:\Users\Public\Documents\Cranes\MinerPic.wmf", False, True, 1, 1, 1, 1)
oPic.ScaleHeight 0.3, True
oPic.ScaleWidth 0.3, True
oPic.Top = Range("p2").Top
oPic.Left = Range("p2").Left
.OnAction = "FC4.xlsm!MineSheet"

or

 pPath = "C:\Users\Public\Documents\Cranes\MinerPic.wmf"
 With ActiveSheet.Pictures.Insert(pPath)
 .Left = Range("p2").Left
 .Top = Range("p2").Top
 .ShapeRange.Height = 50
 .ShapeRange.Width = 50
 .OnAction = "FC4.xlsm!MineSheet"

At one stage I was able to place 52 images on top of each other. I suspect this has something to do with the Activesheet command.

I am extremely new to VBA and would appreciate any help.

Thanks in advance.
Steve.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:15:42+00:00Added an answer on June 8, 2026 at 5:15 pm

    Wrap your code like this

    For i = 1 To 52
        Set sh = ActiveWorkbook.Worksheets("Week" & i)
    
        ' Reference the sh object rather than ActiveSheet
        Set oPic = sh.Shapes.AddPicture( ...
        ' or
        With sh.Pictures.Insert(pPath)
        ' rest of your code
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that loops through a series of sheets in a workbook
I currently have a excel workbook that has values being pulled from other workbooks
Say I have 2 sheets in my workbook. One is a master list that
I have a workbook that has many checkboxes (form control) on one tab. I
I have an Excel Workbook that has several worksheets in it. The tables in
So I have an excel workbook that has a nice global map of shaperange
The workbook has over 50 worksheets and I'm working through an old macro that
I have just tried to send a workbook to a friend that has a
I have an open workbook that has a bunch of macros in it, one
I have a web application that has a requirement to take data from an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.