Runtime error Out of Memory

ISqueal

New Member
Joined
Aug 12, 2017
Messages
6
Beginner VBA user here.

I'm getting a runtime error that says "Out of Memory" with one certain set of code. I have one specific worksheet within a workbook that contains 4 rows each valued as the days Monday, Tuesday, Wednesday, Thursday respectively in Column "A". The nature of the worksheet will add or remove rows between each "Day Named" Row throughout its use. Because of that, I have been trying to develop code that will keep track of which row each "Day Named" Row is so that a user form (which will be used to generate the aforementioned new rows) can use their location as reference.

Here is my code segment for that specific part:

Dim MondayCell As Long
Dim TuesdayCell As Long
Dim WednesdayCell As Long
Dim ThursdayCell As Long
Dim autosht As Worksheet


Set autosht = ThisWorkbook.Worksheets("AutoWISR")
With autosht
MondayCell = .Cells(.Rows.Value = "Monday", "A")
TuesdayCell = .Cells(.Rows.Value = "Tuesday", "A")
WednesdayCell = .Cells(.Rows.Value = "Wednesday", "A")
ThursdayCell = .Cells(.Rows.Value = "Thursday", "A")
End With

As soon as "MondayCell" is defined, I get the runtime error stating "Out of Memory". Can anyone tell me what the issue is and how to free up memory for processing?

Thanks.
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,717
Office Version
2010
Platform
Windows
Cute name. Very professional for a forum.
 

ISqueal

New Member
Joined
Aug 12, 2017
Messages
6
Definitely matches the professionalism of an internet forum. Thanks for the help!
 

Forum statistics

Threads
1,082,258
Messages
5,364,081
Members
400,778
Latest member
Canadian Sal

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top