I apologize for the lack of clarity. I blame it on being new to macros
still, lol.

The first routine is a:

Private Sub Worksheet_Calculate()

Dim oPic As Picture
Me.Pictures.Visible = False
With Range("B3")
    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

I forgot to mention that I pulled this routine from a web example.

The problem I'm having is that when whichever routine I put first,
gets priority and it works. However the 2nd one does not. Putting the
picture change routine first, it does change the pictures. However,
the 2nd routine to hide rows does not work. I would just like to know
how to get them both to work since they are independent routines being
that they are 2 different types of sub routines

Private Sub Worksheet_Calculate()
Private Sub Worksheet_Change(ByVal Target As Range)

I'm not sure how to work it to where both work simultaneously.

Jack

On Nov 10, 11:28 am, Sam Mathai Chacko <samde...@gmail.com> wrote:
> The Worksheet change routine is automatically triggered when there is a
> change (change in value/modification of value etc) in 1 or more cells
> within THAT sheet. So you don't really CALL it, it GETS called, in other
> words, TRIGGERED.
>
> For the first routine, the context is not clear enough to judge when and
> how it has to be called, so a bit more clarity may help
>
> Regards,
> Sam
>
>
>
>
>
>
>
>
>
> On Thu, Nov 10, 2011 at 8:53 PM, Jack <aan...@gmail.com> wrote:
> > I am new to macros. I tried searching the internet for the answer but
> > the limited experience didn't quite help me find my answer. I hope you
> > guys can figure it out.
>
> > I have 2 sub routines. 1 that pulls a photo and another that hides
> > rows based on a value from cell B3. I tried to the Call option but
> > wasn't quite sure how to pull it together. Below are my 2 routines:
>
> > Dim oPic As Picture
> > Me.Pictures.Visible = False
> > With Range("B3")
> >    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
>
> > ------------------------------------------------------------------------------
> > 'Private Sub Worksheet_Change(ByVal Target As Range)
>
> > If Target.Address = "B3" Then
> >   Select Case Target.Value
> >       Case Is = "DSL-Cleaner"
> >           Rows("1:156").Hidden = False
> >           Rows("157:208").Hidden = True
> >           Rows("209:256").Hidden = False
> >       Case Is = "DSN-DSL Cleaner"
> >           Rows("1:256").Hidden = False
> >   End Select
> > End If
> > End Sub
>
> > I greatly appreciate the help.
>
> > --
> > FORUM RULES (934+ members already BANNED for violation)
>
> > 1) Use concise, accurate thread titles. Poor thread titles, like Please
> > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> > will not get quick attention or may not be answered.
>
> > 2) Don't post a question in the thread of another member.
>
> > 3) Don't post questions regarding breaking or bypassing any security
> > measure.
>
> > 4) Acknowledge the responses you receive, good or bad.
>
> > 5)  Cross-promotion of, or links to, forums competitive to this forum in
> > signatures are prohibited.
>
> > NOTE  : Don't ever post personal or confidential data in a workbook. Forum
> > owners and members are not responsible for any loss.
>
> > ------------------------------------------------------------------------------------------------------
> > To post to this group, send email to excel-macros@googlegroups.com
>
> --
> Sam Mathai Chacko

-- 
FORUM RULES (934+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to