dynamic macro help

  • Thread starter Thread starter rpick60
  • Start date Start date
R

rpick60

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
 
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
 
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.










- Show quoted text -

Thanks that worked great!!!
 
Back
Top