VBA Insert row causes Excel to crash

BuddhaJoe

New Member
Joined
Mar 24, 2018
Messages
7
Excel crashes (no response) when a value used in VBA is selected from a ComboBox. It does NOT crash when the value is entered into the ComboBox (rather than selected). My previous thread gets into all the attempted fixes that proved more of a distraction than anything. The Workbook has been totally rebuilt from scratch, so no chance of corruption.
Again, it works perfectly when the value is entered, but always crashes (method will vary) when the value is selected.

The VBA code inserts a row into the spreadsheet above the active cell, and then pastes the value from the ComboBox (actually from the cell linked to the ComboBox) in the LinkedCell Property.
The ComboBox also uses a ListFillRange called My_Range, which is a dynamic range based on a worksheet formula.

I have screenshots of the worksheet showing the 2 methods of entering the value mentioned above. Not sure how to attach them, as I have not uploaded them to get a URL.

I am grateful for the responses to my last thread, and look forward to ideas on how to proceed.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Re: VBA Insert row causes Excel to crash: PART 2 (Declared victory too early)

Here are screenshots showing the 2 conditions: [TABLE="width: 389"]
<tbody>[TR]
[TD="class: xl64, width: 389"]https://imgur.com/a/sfUef[/TD]
[/TR]
</tbody>[/TABLE]

sfUef
 
Upvote 0
Re: VBA Insert row causes Excel to crash: PART 2 (Declared victory too early)

LAST bit of even more detailed (and curious) information: As weird as this seems, entering (pasting) a "real" plant name from "the list" (in another sheet of the Workbook), causes Excel to crash, even though the plant name was NOT SELECTED from the ComboBox. SO . . . the key distinction seems to be whether or not the Plant Name entered results in a valid RANGE (the Defined Name "My_Range" referenced by the ComboBox Property ListFillRange.
WHAT THIS MEANS is: When a not-existent plant name is entered, the range formula evaluates to NOTHING. When an actual plant name is used (even if ENTERED rather than Selected), the Rangle resolves as valid Range. That's when VBA crashes Excel . . . Hmmmm
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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