Calling out variables in XLM

bsquared

New Member
Joined
Feb 18, 2011
Messages
12
One problem I've never quite straightened out is naming variables.

The only way I seem to be able to reliably create variables is by using the FOR() command whose first entry is a counter variable.

When I'm jumping between documents it is sometimes handy to carry a value loaded in a variable. My technique since I don't know how to call them out is to load the variable into a cell of the macro itself and then call that cell for the variable, but it frustrates me that I can't figure the variable thing out and there were a few really cogent lurkers out here over the last couple days who, when stretched, remembered their XLM so I though I'd ask while I was thinking about it. Elsewise, I'll finish this project and not figure this out yet again and I've been trying to find out for 4 or 5 years.

so if you can enlighten thanks,

PS -

I got Crossover for the Mac actually unzipped the macrofun.exe file and then opened it with Microsoft Word and the word variable only shows up one time in the whole thing as a tag to an article it seems. That is the same with my Excel 2.2 book. I cannot figure out how they can't have devoted a little more attention to the concept, but mayb the metaphor of a macro cell address as a variable address was what everybody used.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Got it, its

Code:
SET.NAME("name",value)

but this brings up one more question. What I'm trying to put in the value is the name of the active document. I'm trying to Push the name of the active document so I can Pop it to get back and I'm going to run this macro on a bunch of documents so I can't just enter the name.

There is a

Code:
DOCUMENTS()
function that returns an array with an alpha list of the open documents, but, of course, this doesn't tell you which document you were in to begin with.

so what I need is really like THIS.DOCUMENT() or ACTIVE.DOCUMENT() function, if anyone knows of one.

thanks,

brian
 
Upvote 0
For Excel it would be ActiveWorkbook.Name in VBA. Or are you talking about from another language?
 
Upvote 0
For Excel it would be ActiveWorkbook.Name in VBA. Or are you talking about from another language?

Yeah, I'm in XLM from Excel 4.0

ACTIVE.CELL() is a function so if ActiveWorkbook.Name is the call in VB maybe I could walk this back if I knew the call that returned a reference to the active cell. Is ActiveCell ? I'm going to try ACTIVE.WORKBOOK() and see what that returns.

thanks and if there are an XLM heads on tonite . . .

Brian
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,576
Members
449,173
Latest member
Kon123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top