Converting a range to string

R

Robert Stober

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

J.E. McGimpsey

One way:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top