Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need some help fixing some code. I'm still learning about VB so
hopefully, this will be easy for someone else. I'm trying to create a pivot table from a list of cells with a variable length. I'm trying to use the LASTROW function from Ron DeBruin and I can't seem to get it to work. I want the LASTROW function to look at data in worksheet "WorksheetNames" Set SourceSh = ThisWorkbook.WorksheetNames SourceSh.Name = "WorksheetNames" Sheets("WorksheetNames").Select Debug.Print Last Last = LastRow(SourceSh) Debug.Print Last ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "WorksheetNames!$A$1:$C$" & Last).CreatePivotTable TableDestination:="", TableName:= _ "PivotTable1", DefaultVersion:=xlPivotTableVersion10 Thanks in advance, Barb Reinhardt |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need assistance with how or even if this is possible (function) | Excel Worksheet Functions | |||
Lastrow - function not defined | Excel Discussion (Misc queries) | |||
LastRow function - #VALUE | Excel Programming | |||
'LastRow' Function not working | Excel Programming | |||
Go to lastrow using other column's lastrow | Excel Programming |