Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-27-2012, 04:21 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline VBA: Include Dynamic Sheet Name In Pivot Table Source Data Windows 7 32bit VBA: Include Dynamic Sheet Name In Pivot Table Source Data Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

I haven't tested your code but you need to concatenate your SName string variable (and also include ' to allow for spaces within the sheet name):
Code:
"Sheets(Sname)!R1C1:R46C2",
becomes:
Code:
"'" & Sname & "'!R1C1:R46C2",
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
sheet 2 data highlight in sheet 1 gsrikanth Excel 1 04-21-2012 06:25 PM
VBA: Include Dynamic Sheet Name In Pivot Table Source Data Help with a pivot table please! natsha Excel 1 02-16-2012 12:41 PM
Edit Data Source- Linking template charts to new data lbf PowerPoint 0 10-28-2011 12:19 PM
pivot table source data hannu Excel 0 07-03-2010 04:54 AM
Include headers in table of contents bwhight Word 1 10-10-2006 08:59 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft