Thread
: [Solved]
VBA: Include Dynamic Sheet Name In Pivot Table Source Data
View Single Post
04-27-2012, 04:21 PM
Colin Legg
Windows 7 32bit
Office 2010 32bit
Expert
Join Date: Jan 2011
Location: UK
Posts: 369
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",
__________________
Colin
RAD Excel Blog
Colin Legg
View Public Profile
Find all posts by Colin Legg