Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default macro picture setting

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Dim myCell As Range
Dim myRng As Range

Me.Pictures.Visible = False

Set myRng = Me.Range("a1,a3")

For Each myCell In myRng.Cells
With myCell
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
Next myCell
End Sub

i currently has this macro.
is there a way to set all my picture size and fix it??

and when i copy everything to a new sheet, some picture seem to be gone.??
any idea what happen?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default macro picture setting

See if this works better. You picture names may not exactly match the name
in text in the cells. I think depending on how you copy the pictures the
picture names may change when you go from sheet to sheet. You can see the
picture names if you click on the picture and then look in the NAME BOX in
the tool bars at the top of the worksheet. It is usally to the left of the
F(x) box where you enter formulas. Compare the names of the picture in the
original sheet and the new sheet to see if they match.

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Dim myCell As Range
Dim myRng As Range

Me.Pictures.Visible = False

Set myRng = Me.Range("a1,a3")

For Each myCell In myRng.Cells
With myCell
set oPic = me.pictures(.text)
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Next oPic
End With
Next myCell
End Sub


"Oligo" wrote:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Dim myCell As Range
Dim myRng As Range

Me.Pictures.Visible = False

Set myRng = Me.Range("a1,a3")

For Each myCell In myRng.Cells
With myCell
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
Next myCell
End Sub

i currently has this macro.
is there a way to set all my picture size and fix it??

and when i copy everything to a new sheet, some picture seem to be gone.??
any idea what happen?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting for "original picture" size sumatradc Excel Discussion (Misc queries) 0 June 16th 06 04:39 PM
Macro to enlarge a picture WightRob Excel Discussion (Misc queries) 10 June 7th 06 07:08 AM
delete picture with macro Steve Excel Discussion (Misc queries) 1 March 16th 06 10:12 PM
Setting up a Macro Nabeel Excel Worksheet Functions 2 February 25th 06 08:22 PM
Position Picture with macro G Setting up and Configuration of Excel 1 November 28th 05 07:25 PM


All times are GMT +1. The time now is 09:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"