Help with VBA code

Status
Not open for further replies.

omkar94

New Member
Joined
Apr 26, 2017
Messages
24
Hi Guys,


Someone helped me write a code small code below, but I cant get it to work.
When I press F5, the macro name does not show up, and I an unable to proceed on with the code.
Please take a look below and see if you could help me figure it out. Also, If you would like to figure out the purpose of the code pleas click on the original post Here.


Code:
Sub CreateDynaPivot(ByVal paramSheet As String, ByVal paramRange As String)

'\\Find Last cell in the datase
Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Select

'\\Generate Pivot table and loop dynamic ranges
Do Until ActiveCell.Address = "$L$1"
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:="report1!" & paramRange, Version:=6).CreatePivotTable TableDestination:=paramSheet & "!R3C1", TableName:="PivotTable2", DefaultVersion:=6
Sheets(paramSheet).Select

'.... the rest of your code

 
End Sub


Thank you,


Omkar V
 
Last edited by a moderator:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Please don't start a duplicate thread - carry on in the original one. You can bump that one (no more than once a day) if you aren't getting a response there.

This one is now closed.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,828
Messages
6,181,210
Members
453,023
Latest member
alabaz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top