ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calling a VBA add in from a macro subroutine (https://www.excelbanter.com/excel-programming/386997-calling-vba-add-macro-subroutine.html)

[email protected]

Calling a VBA add in from a macro subroutine
 
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


Dave Peterson

Calling a VBA add in from a macro subroutine
 
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?????



wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 07:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com