Hello,
Sub Macro1()
Range("F2").Select
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
"MARTIN!R2C1:R155C8"
End Sub
Above stands a part of a macro to create a pivot table. With the following I have a problem:
SourceData:="MARTIN!R2C1:R155C8"
If the sheet has a name other then MARTIN I get an error.
I want to play the macro whatever the sheet name is!
How can I make that happem?!
Sub Macro1()
Range("F2").Select
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
"MARTIN!R2C1:R155C8"
End Sub
Above stands a part of a macro to create a pivot table. With the following I have a problem:
SourceData:="MARTIN!R2C1:R155C8"
If the sheet has a name other then MARTIN I get an error.
I want to play the macro whatever the sheet name is!
How can I make that happem?!