Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Die_Another_Day,
Thanks again very much. Eric "Die_Another_Day" wrote: Function FindLastCell() As Range Dim LastColumn As Integer Dim LastRow As Long Dim LastCell As Range If WorksheetFunction.CountA(Cells) 0 Then 'Search for any entry, by searching backwards by Rows. LastRow = Cells.Find(What:="*", After:=[A1], _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row 'Search for any entry, by searching backwards by Columns. LastColumn = Cells.Find(What:="*", After:=[A1], _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious).Column Set FindLastCell = Cells(LastRow, LastColumn) Else Set FindLastCell = Range("A1") End If End Function That's the function I use. Hope it helps Die_Another_Day ecctse wrote: Hi again Die_Another_Day, You're a real champ. Your codes work perfectly. Just 1 more question: where can I locate your FindLastRow object? Very much appreciated & have a great weeekend. Eric "ecctse" wrote: Hi, I am trying to create a pivot tables using VBA with different number of rows of source data. How can I supply the number of rows as a parameter to the following method: ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:="???" It seems it doesn't like me to supply a string variable to the SourceData, for example, SourceData:= strRange Any other method to get around? Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I detail Pivot Table data without creating a table (Excel2007) | Excel Discussion (Misc queries) | |||
How can I detail Pivot Table data without creating a table (Excel2007) | Excel Discussion (Misc queries) | |||
creating a report from a table, pivot table not suitable | Excel Worksheet Functions | |||
creating a pivot table from 4 pivot tables | Excel Worksheet Functions | |||
Creating Pivot Table with VBA | Excel Programming |