Calling a VBA add in from a macro subroutine

M

madboy_1

Hi,

dont shoot me down in flames as im a newbie ;) I have an add in that
was kindly made by a collegue of mine It uses various functions and
has no subroutines. The add in works when you highlight a cell and
press the add in.

Im trying to make a sub routine that will call run this add in for
every cell . For some odd reason only the last cell in the list works
correctly and all the others are skipped

can anyone help ?



Range("A1").Select

Dim i As String
i = ActiveCell
If i > "" Then
Application.Run "Myprogram.xla!RALShowmetherecord()"
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub
 
D

Dave Peterson

I don't think the code was what you got working, but maybe...

Option Explicit
Sub Testme()
Dim i As String
Range("A1").Select
do
i = ActiveCell.value
If i = "" Then
exit do
end if
Application.Run "Myprogram.xla!RALShowmetherecord()"
ActiveCell.Offset(1, 0).Select
Loop
End Sub

If this doesn't work, then maybe it's not your code that has the problem--maybe
it's something in the addin's procedure?????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top