Using the Range Method to Convert String to a Range (126367)
The information in this article applies to:
- Microsoft Excel 97 for Windows
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 5.0
This article was previously published under Q126367 SUMMARY
In Microsoft Excel, when you use the GoTo method in a Visual Basic for
Applications procedure, you must use a Visual Basic object style
reference, such as the following:
Worksheets("Sheet1").Range("A1")
However, many functions that return worksheet or chart values return the
<SheetName>!<CellReference> style reference.
Using string manipulation, it is possible to take a
<SheetName>!<CellReference> style reference result and use it as an
argument of the Range method. The Range method then converts a
<SheetName>!<CellReference> style reference to a Visual Basic object
style reference that can be used with the GoTo method. The following are
examples of using the Range method to accomplish this.
REFERENCES
"Visual Basic User's Guide," version 5.0, Chapter 3, "Creating User
Defined Functions"
"Visual Basic User's Guide," version 5.0, Chapter 5, "Working with
Objects in Visual Basic"
Modification Type: | Minor | Last Reviewed: | 8/15/2005 |
---|
Keywords: | KB126367 |
---|
|