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.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Cute name. Very professional for a forum.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top