"Object variable or With block variable not set" but it is, help

LlebKcir

Board Regular
Joined
Oct 8, 2018
Messages
219
Code:
Private Sub NetworkComboBox_Change()

Dim FoundCell As Range
Dim ws As Worksheet
Dim i As Integer
Dim rng As String
' Dim FoundMax As Integer  - Now set as global variable

Set ws = ActiveSheet

GroupComboBox.Clear             ' Clear current Group ComboBox

Set FoundCell = ws.Range("A:A").Find(What:=NetworkComboBox.Value) ' Find the cell for the selected network
rng = "B" & FoundCell.Row       ' Build the string for the range of the max value
FoundMax = Range(rng).Value     ' Assign the maximum group number
For i = 1 To FoundMax
    GroupComboBox.AddItem i
Next i

End Sub

The debugger is yellow on the rng variable. well that is clearly set. This code has been working for months now this morning it is having all kinds of issues. The save as function seems to also be having strange issues. Again that code has been working for months and this morning all freaking out.

any clue? Thank you in advance.
 

Attachments

  • Table.Debug-21-Feb-2020.PNG
    Table.Debug-21-Feb-2020.PNG
    19.9 KB · Views: 25
  • Table.Error-21-Feb-2020.PNG
    Table.Error-21-Feb-2020.PNG
    4.1 KB · Views: 24
That response could be interpreted as sincere or sarcastic, do I need to add you to my 'ignore' list?
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Cool, thanks for clearing it up. I expect many people have made similar replies without realising how easily it can be misinterpreted.

my coding skills suck
I have about 5% skill, the rest is luck and trying to remember what worked before ?
 
Upvote 0
i hear ya. as I know my skills are horrid, i do try to thank those who provide knowledge and help.
 
Upvote 0
i do try to thank those who provide knowledge and help.
That is a manner that I respect sincerely, there are many who are far less courteous.

Please keep us posted on progress with the suggested change, if it still doesn't work then we can look into it a bit more and see what else we can find.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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