Executing a macro in another file

N

NSNR

I have created a macro and stored in XL Start folder under Msoffice folder of
C: drive. Also I have assigned Ctrl+A as the key for the macro.

My requirement is: I open a new excel file, execute the macro by typing
Ctrl+A keys. Now it should accept few inputs, do the calculations as defined
in the macro and the results should be displayed in the cells of the above
mentioned open excel fie.

Pl Can anybody suggest me solutions for this ?

reply to my posts are welcome
 
P

Pranav Vaidya

Hi,

I am not very sure how your current macro looks like and what type of
calculations it does. However, I think, if you follow the below approach it
might help

1. Create an Excel Ass-in and store your macro in this add-in.
2. You can use Excel VBA Objects such as ActiveWorkbook, ActiveSheet, Range
etc.
3. You can use Excel VBA Collections such as Sheets, Workbooks etc
4. Eventually, based on nature of calculation, you may want to use looping
constructs such as For...Next, Do while...Loop and conditional statements
such as IF..Else...End IF

HTH,
 

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