VBA- "Out of Memory" message

ilcaa

Well-known Member
Joined
May 25, 2005
Messages
686
I am creating a template, and have some formatting and 4 very basic macros. I try to rename, create a new macro and I keep getting a message that I dont have enough memory.

any one encounter this, how do i resolve?

thanks for any help.
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

ilcaa

Well-known Member
Joined
May 25, 2005
Messages
686
These are the formulas,

Sub insertnetformula()
'
' insertnetformula Macro
' Macro recorded 10/18/2006 by santos
'

'
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-3]="""","""",IF(RC[-3]=""buy"",-RC[-2]*RC[1],RC[-2]*RC[1]))"
Range("H3").Select
End Sub

Sub insertformulaPrice()
'
' insertformulaPrice Macro
' Macro recorded 10/18/2006 by santos
'
Range("I2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-2]="""","""",staticquote(RC[-2],compFromShort(""Last""),""X""))"
Range("I3").Select
End Sub


Sub deleterowifcellblank()
' this code will delete all rows where
' a cell in COL 'E' is empty

Application.ScreenUpdating = True
[e:e].AutoFilter Field:=1, Criteria1:="="
[e2:e65536].SpecialCells(xlVisible).EntireRow.Delete
If [e1] = "" Then [1:1].Delete
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub


Sub Fill_Net_and_Price()
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-3]="""","""",IF(RC[-3]=""buy"",-RC[-2]*RC[1],RC[-2]*RC[1]))"
Range("I2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-2]="""","""",staticquote(RC[-2],compFromShort(""Last""),""X""))"
Range("h2:i2").Select
Range("h2:i2" & Range("g65536").End(xlUp).Row).Select
Selection.FillDown
End Sub
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,913
Office Version
  1. 365
Platform
  1. Windows
Are staticquote and compFromShort user defined functions?

If they are I think that perhaps the error is caused by them rather than the posted code, which looks fine.
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Sorry, I can't see anything in there that would cause "Out of memory". Perhaps a close and restart of Excel is called for.
 

Watch MrExcel Video

Forum statistics

Threads
1,113,850
Messages
5,544,660
Members
410,628
Latest member
mike5
Top