I had a simple marco to hide a sheet and some rows when a listbox is clicked. it ran fine in the listbox's sheet's code but I had to move it to a global module in order to go hide rows in another sheet. Now it says the objects don't exist.
Here is my code
Where lbCulturesLait is a listbox I'm trying to change,
Lait is a worksheet
Champs is a worksheet
lignesLait is a named range
All of these lines seem to fail yet when I look at guides and references it seems to me like this is supposed to be the right syntax.
Here is my code
Code:
Public Sub ActiverLait()
Lait.Visible = 1 'Afficher feuille Lait
Lait.lbCulturesLait.BackColor = &HC0FFFF
Lait.lbCulturesLait.Enabled = True
Champs.Range("lignesLait").EntireRow.Hidden = False
Champs.Names("lignesLait").RefersToRange.EntireRow.Hidden = False
End Sub
Lait is a worksheet
Champs is a worksheet
lignesLait is a named range
All of these lines seem to fail yet when I look at guides and references it seems to me like this is supposed to be the right syntax.