Macro and VBA variable locations

BennieC

New Member
Joined
Jul 23, 2010
Messages
8
Hi,
Now that i can create macros and place results anywhere I have another challenge. Invariably my spreadsheets change,so locations move. How can my macros, which now refer to specific locations be told to find there source data at the new locations, without editing?

I have also created some functions which I call for complex calculations. I have loaded them as add-ins, but moving the program between computers requires me to always, on the specific computer, reload the call in the cells - am I doing something wrong?
Bennie
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
Are you looking for something like:
ThisWorkbook.Path
or
ActiveWorkbook.Path
About Addins:
place the XLA file in:
"%userprofile%\Application Data\Microsoft\AddIns"
and enable the Addin (Tools -> Addins...) - then the macros and functions should be working normally
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,885
Messages
5,513,978
Members
408,980
Latest member
Naomi_

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top