ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Converting a range to string (https://www.excelbanter.com/excel-programming/278735-converting-range-string.html)

Robert Stober

Converting a range to string
 
Hi,

I've got a range object that I want to convert to a string so I can use in
the PivotTableWizard method:

Dim rng As Range
set rng = Sheets("sales").Range("A1").CurrentRegion

I want to convert rng into a string like this:

"sales!R1C1:R796C6"

Any help you can provide will be greatly appreciated.

Robert Stober



J.E. McGimpsey

Converting a range to string
 
One way:

str = rng.Parent.Name & "!" & rng.Address(True, True, False, False)


In article ,
"Robert Stober" wrote:

Hi,

I've got a range object that I want to convert to a string so I can use in
the PivotTableWizard method:

Dim rng As Range
set rng = Sheets("sales").Range("A1").CurrentRegion

I want to convert rng into a string like this:

"sales!R1C1:R796C6"

Any help you can provide will be greatly appreciated.

Robert Stober




All times are GMT +1. The time now is 06:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com