I have a list of PDF Manual files in ColumnP in ColumnQ I have VBA
project that when the cell is selected it grabs the file name with
cell.offset 0 -1 and opens the file in column P. My question is how
can have a simple command that would do this to all rows (500) rather
then type seperate if statements for each row. Here is the code I am
using.

If Target.Address(0, 0) = "P9" Then
openpdf
End If

my openpdf macro has this in it to grab the file name

myFileName = ActiveCell.Offset(0, -1)

Does any one have an idea?

Thanks in advanced

Re: dynamic macro help by Otto

Otto
Sun Dec 02 19:26:32 PST 2007

Something like:
If Target.Column=16 And Target.Row>5 Then
If Target.Value<>"" then
openpdf
End if
End If
If the row doesn't matter, remove the "And Target.Row>5".
This will fire the open code if anything is put in Column P after row 5.
HTH Otto
"rpick60" <rpick60@yahoo.com> wrote in message
news:a37e453e-18cd-4cca-801e-e1c012f2876f@e23g2000prf.googlegroups.com...
>I have a list of PDF Manual files in ColumnP in ColumnQ I have VBA
> project that when the cell is selected it grabs the file name with
> cell.offset 0 -1 and opens the file in column P. My question is how
> can have a simple command that would do this to all rows (500) rather
> then type seperate if statements for each row. Here is the code I am
> using.
>
> If Target.Address(0, 0) = "P9" Then
> openpdf
> End If
>
> my openpdf macro has this in it to grab the file name
>
> myFileName = ActiveCell.Offset(0, -1)
>
> Does any one have an idea?
>
> Thanks in advanced
>



Re: dynamic macro help by rpick60

rpick60
Sun Dec 02 19:57:39 PST 2007

On Dec 2, 10:26 pm, "Otto Moehrbach" <ottokm...@comcast.net> wrote:
> Something like:
> If Target.Column=16 And Target.Row>5 Then
> If Target.Value<>"" then
> openpdf
> End if
> End If
> If the row doesn't matter, remove the "And Target.Row>5".
> This will fire the open code if anything is put in Column P after row 5.
> HTH Otto"rpick60" <rpic...@yahoo.com> wrote in message
>
> news:a37e453e-18cd-4cca-801e-e1c012f2876f@e23g2000prf.googlegroups.com...
>
>
>
> >I have a list of PDF Manual files in ColumnP in ColumnQ I have VBA
> > project that when the cell is selected it grabs the file name with
> > cell.offset 0 -1 and opens the file in column P. My question is how
> > can have a simple command that would do this to all rows (500) rather
> > then type seperate if statements for each row. Here is the code I am
> > using.
>
> > If Target.Address(0, 0) = "P9" Then
> > openpdf
> > End If
>
> > my openpdf macro has this in it to grab the file name
>
> > myFileName = ActiveCell.Offset(0, -1)
>
> > Does any one have an idea?
>
> > Thanks in advanced- Hide quoted text -
>
> - Show quoted text -

Thanks that worked great!!!

Re: dynamic macro help by Otto

Otto
Mon Dec 03 06:38:49 PST 2007

Thanks for the feedback. Otto
"rpick60" <rpick60@yahoo.com> wrote in message
news:2076dd23-ee60-40bd-8f47-596dd0cb231c@l16g2000hsf.googlegroups.com...
> On Dec 2, 10:26 pm, "Otto Moehrbach" <ottokm...@comcast.net> wrote:
>> Something like:
>> If Target.Column=16 And Target.Row>5 Then
>> If Target.Value<>"" then
>> openpdf
>> End if
>> End If
>> If the row doesn't matter, remove the "And Target.Row>5".
>> This will fire the open code if anything is put in Column P after row 5.
>> HTH Otto"rpick60" <rpic...@yahoo.com> wrote in message
>>
>> news:a37e453e-18cd-4cca-801e-e1c012f2876f@e23g2000prf.googlegroups.com...
>>
>>
>>
>> >I have a list of PDF Manual files in ColumnP in ColumnQ I have VBA
>> > project that when the cell is selected it grabs the file name with
>> > cell.offset 0 -1 and opens the file in column P. My question is how
>> > can have a simple command that would do this to all rows (500) rather
>> > then type seperate if statements for each row. Here is the code I am
>> > using.
>>
>> > If Target.Address(0, 0) = "P9" Then
>> > openpdf
>> > End If
>>
>> > my openpdf macro has this in it to grab the file name
>>
>> > myFileName = ActiveCell.Offset(0, -1)
>>
>> > Does any one have an idea?
>>
>> > Thanks in advanced- Hide quoted text -
>>
>> - Show quoted text -
>
> Thanks that worked great!!!