Returns the formatted text for the specified object. Read-only String.
View a macro's code. If you want to learn more about how macro coding works, you can open the code of any macro you've created and tinker with it: Click the Macros button in the Developer tab. Click the macro you want to view. Click the Edit button. View your macro code in the Visual Basic code editing window. Open the Text Macros palette from the Window menu if it’s not already open, then click the New Macro icon at the bottom of the palette (it looks like a dog-eared page). If you prefer menus, you could choose New Macro from the palette menu instead, or if you’re a keyboard shortcut fan, just type Ctrl-Alt-F8 (Command-Option-F8 on a Mac. A macro is a series of commands and instructions that you group together as a single command to accomplish a task automatically. To save time on tasks you do often, bundle the steps into a macro. First, you record the macro. Then you can run the macro by clicking a button on the Quick Access Toolbar or pressing a combination of keys.
Syntax
expression.Text
expression A variable that represents a Range object.
Remarks
The Text property is most often used for a range of one cell. If the range includes more than one cell, the Text property returns Null, except when all the cells in the range have identical contents and formats.
If the contents of the cell is wider than the width available for display, the Text property will modify the displayed value.
Property Differences Example
Text Macro Steelseries
This example illustrates the difference between the Text and Value properties of cells that contain formatted numbers.
Text Macro App
Text Width Differences
How To Import A Text Macro In Athena Ehr
Cells containing numeric values may have their displayed value modified when the column isn't wide enough. The example below shows this using two columns. The first column is wide enough to display the values. A format is applied and then a value entered showing the full value. The second column has its width reduced such that when the cells are copied over it is too narrow causing the displayed value to be moified.
Text Macro
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
- If you want to create a text macro from existing text,select the text in the document.
- Choose New Macro from the Text Macros panel menu, orclick the New Macro button inthe Text Macros panel.
- Enter a macro code in the Macro Code text box. Note thatmacro codes are case-sensitive.
- For Macro Text, type the text string that you want enteredwhen you activate the text macro.
- To include text attributes from the existing text wheninserting or swapping macro text, select Remember Text Attributes.
By default, inserted or swapped macro text uses the styleattributes of the destination paragraph.
- To assign a keyboard shortcut for activating the macro,place the cursor in the Macro Key Shortcut text box, andpress the keys you want to use for the shortcut.
Shortcuts are especially useful if you turn off AutomaticallySwap Macro Text in the Text Macros panel.
If the keyboardshortcut you want to assign to the macro is already assigned to anotherfunction, the alert symbol appears at the bottom of the dialog boxwith the message “Currently Assigned To: [function].”If you choose to assign the keyboard shortcut to the macro, theprevious keyboard shortcut function is overridden.