Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
PLACING PIC IN WORKSHEET USING MACRO
I have built a worksheet with the following macro to insert a picture if a
certain cell is true. My question is that: I have three more pics to add if other individual cells are true. How do i code this? The following is the code that David gave to me and it works fine for that one picture. But two or more pictures for different cells?????? Thanks, GlennOption Explicit Private Sub Worksheet_Calculate() Dim oPic As Picture Me.Pictures.Visible = False With Range("I2") 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 End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
PLACING PIC IN WORKSHEET USING MACRO
One way:
Private Sub Worksheet_Calculate() Dim oPic As Picture Dim rCell As Range Application.ScreenUpdating = false Me.Pictures.Visible = False For Each rCell In Range("I2, J4, K6, L8") With rCell 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 rCell Application.ScreenUpdating = True End Sub In article , "Glenn" wrote: I have built a worksheet with the following macro to insert a picture if a certain cell is true. My question is that: I have three more pics to add if other individual cells are true. How do i code this? The following is the code that David gave to me and it works fine for that one picture. But two or more pictures for different cells?????? Thanks, GlennOption Explicit Private Sub Worksheet_Calculate() Dim oPic As Picture Me.Pictures.Visible = False With Range("I2") 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 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying rows of data into new worksheet but placing data into colu | Excel Discussion (Misc queries) | |||
Placing external data in a worksheet | Excel Worksheet Functions | |||
Searching for data and placing in new worksheet | Excel Worksheet Functions | |||
retaining fonts when placing excel worksheet into pagemaker? | Excel Discussion (Misc queries) | |||
Worksheet reference (i.e placing worksheet name in a cell) | Excel Worksheet Functions |