Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get Range Address from a String
I've loaded a cell address into a string via the following macro:
Sub Test() Dim Rng As String Rng = ActiveCell.Address(external:=True) Debug.Print Rng End Sub Is there a way to convert the string back to full cell address (workbook, worksheet, and cell address) without parsing the string? Thanks for your help. -- Steph |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get Range Address from a String
If you mean convert back to a range..then
Dim myRange as Range Set myRange = Range(Rng) If this post helps click Yes --------------- Jacob Skaria "Steph" wrote: I've loaded a cell address into a string via the following macro: Sub Test() Dim Rng As String Rng = ActiveCell.Address(external:=True) Debug.Print Rng End Sub Is there a way to convert the string back to full cell address (workbook, worksheet, and cell address) without parsing the string? Thanks for your help. -- Steph |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get Range Address from a String
Or do you mean,...
Sub Test() Dim Rng As String Rng = ActiveCell.Address(external:=True) Debug.Print Rng 'convert it back Dim myRange As Range Set myRange = Range(Rng) Debug.Print myRange.Address(external:=True) End Sub If this post helps click Yes --------------- Jacob Skaria "Jacob Skaria" wrote: If you mean convert back to a range..then Dim myRange as Range Set myRange = Range(Rng) If this post helps click Yes --------------- Jacob Skaria "Steph" wrote: I've loaded a cell address into a string via the following macro: Sub Test() Dim Rng As String Rng = ActiveCell.Address(external:=True) Debug.Print Rng End Sub Is there a way to convert the string back to full cell address (workbook, worksheet, and cell address) without parsing the string? Thanks for your help. -- Steph |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get Range Address from a String
Hello Steph, By setting an object variable to equal the active cell, you can derive all the information you want like this... Dim Addx As String Dim Rng As Range Dim WksName As String Dim WkbName As String Set Rng = ActiveCell Addx = Rng.Address WksName = Rng.Parent.Name WkbName = Rng.Parent.Parent.Name Sincerely, Leith Ross -- Leith Ross Sincerely, Leith Ross 'The Code Cage' (http://www.thecodecage.com/) ------------------------------------------------------------------------ Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=108727 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to create a range address with ADDRESS function? | Excel Worksheet Functions | |||
return cell address of longest text string in a range | Excel Discussion (Misc queries) | |||
Pass a string to an address | Excel Programming | |||
Using a string to reference an address | Excel Programming | |||
Passing Cell Address (String or Range) | Excel Programming |