Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27008

out of Memory Error

$
0
0
I have a pretty single code and my if then function is causing an out of memory error
Sub Macro16()
'
' Macro16 Macro
'
Dim ProjName As String
For x = 1 To 51
Sheets("sheet10").Activate
If cells.Value = "" Then
Sheets("sheet10").Activate
cells(x, 1).Select
ProjName = ActiveCell.Value
Sheets("DATA").Activate
ActiveSheet.PivotTables("PivotTable5").AddDataField ActiveSheet.PivotTables( _
"PivotTable5").PivotFields(ProjName), "Count of " & ProjName _
, xlCount
With ActiveSheet.PivotTables("PivotTable5").PivotFields( _
"Count of " & ProjName)
.Caption = "Average of " & ProjName
.Function = xlAverage
.NumberFormat = "$#,##0.00"
End With
End If

Next
End Sub

Viewing all articles
Browse latest Browse all 27008

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>