Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 3rd, 2003, 02:18 PM
Authorized User
 
Join Date: Sep 2003
Location: Escalon, CA, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Know how to convert a range to a 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



Reply With Quote
  #2 (permalink)  
Old October 3rd, 2003, 02:23 PM
Authorized User
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default


s = "sales!" & rng.Address(ReferenceStyle:=xlR1C1)
Reply With Quote
  #3 (permalink)  
Old October 4th, 2003, 09:06 PM
Authorized User
 
Join Date: Sep 2003
Location: Escalon, CA, USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you helentoomik. That's much cleener than the way I came up with...

Reply With Quote
  #4 (permalink)  
Old September 11th, 2009, 10:28 AM
Registered User
 
Join Date: Sep 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
how to select data on different sheet
my problem is
i am having data on different sheet and graph on different sheet
the sheet which contains graph is programically created..

thanx n regards
Reply With Quote
  #5 (permalink)  
Old September 11th, 2009, 09:12 PM
Friend of Wrox
Points: 2,950, Level: 22
Points: 2,950, Level: 22 Points: 2,950, Level: 22 Points: 2,950, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
Posts: 788
Thanks: 1
Thanked 51 Times in 47 Posts
Default

Hi

In the following code mentioned earlier

s = "sales!" & rng.Address(ReferenceStyle:=xlR1C1)

Replace 'sales' with appropriate sheet name

if the sheet is getting programmatically generated then use that sheet object's name

oSht,Name

or

Activesheet.name




s = Activesheet.name & "!" & rng.Address(ReferenceStyle:=xlR1C1)

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
Reply With Quote
  #6 (permalink)  
Old September 12th, 2009, 08:49 AM
Registered User
 
Join Date: Sep 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default thanx

thanx for help.. ;)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert to string prafullaborade XML 7 May 29th, 2008 02:59 PM
convert string to xml prafullaborade XML 3 May 21st, 2008 06:56 AM
Convert string to Date rprasad012 ASP.NET 1.0 and 1.1 Basics 1 March 19th, 2008 07:07 AM
Convert a string into a variable jtrifts VBScript 4 February 21st, 2008 08:08 AM
Convert string to datetime nkovacevic General .NET 4 April 5th, 2005 11:57 AM



All times are GMT -4. The time now is 08:05 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.