• Privacywetgeving
    Het is bij Helpmij.nl niet toegestaan om persoonsgegevens in een voorbeeld te plaatsen. Alle voorbeelden die persoonsgegevens bevatten zullen zonder opgaaf van reden verwijderd worden. In de vraag zal specifiek vermeld moeten worden dat het om fictieve namen gaat.

Waarom vba niet in lijst macro's

Status
Niet open voor verdere reacties.

martins wwa

Gebruiker
Lid geworden
6 nov 2008
Berichten
18
Hallo ,

Wellicht een domme vraag, maar waarom kan ik deze vba niet terugvinden in mijn macrolijst om er een knop bij te voegen. Waarschijnlijk is hier een hele logische verklaring voor...:o maar ik weet deze niet..

[SQL]
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If [B2].Value = "" And [C2].Value = "st." And [C2].Value = "st." Or [B2].Value = "" And [C2].Value = "" Or [C2].Value = "%" Then
Rows("2").EntireRow.Hidden = True
Else
Rows("2").EntireRow.Hidden = False
End If
End Sub
[/SQL]

mvg Martijn
 
Omdat het een werkblad-event is en geen standaard module code.
Als je de code zo in een standaardmodule zet vind je het wel terug.
Code:
[COLOR=#ff0000]sub Martins()[/COLOR]
[COLOR=#993333][B]IF[/B][/COLOR] [COLOR=#66cc66][[/COLOR]B2[COLOR=#66cc66]][/COLOR][COLOR=#66cc66].[/COLOR]Value [COLOR=#66cc66]=[/COLOR] [COLOR=#ff0000]""[/COLOR] [COLOR=#993333][B]AND[/B][/COLOR] [COLOR=#66cc66][[/COLOR]C2[COLOR=#66cc66]][/COLOR][COLOR=#66cc66].[/COLOR]Value [COLOR=#66cc66]=[/COLOR] [COLOR=#ff0000]"st."[/COLOR] [COLOR=#993333][B]AND[/B][/COLOR] [COLOR=#66cc66][[/COLOR]C2[COLOR=#66cc66]][/COLOR][COLOR=#66cc66].[/COLOR]Value [COLOR=#66cc66]=[/COLOR] [COLOR=#ff0000]"st."[/COLOR] [COLOR=#993333][B]OR[/B][/COLOR] [COLOR=#66cc66][[/COLOR]B2[COLOR=#66cc66]][/COLOR][COLOR=#66cc66].[/COLOR]Value [COLOR=#66cc66]=[/COLOR] [COLOR=#ff0000]""[/COLOR] [COLOR=#993333][B]AND[/B][/COLOR] [COLOR=#66cc66][[/COLOR]C2[COLOR=#66cc66]][/COLOR][COLOR=#66cc66].[/COLOR]Value [COLOR=#66cc66]=[/COLOR] [COLOR=#ff0000]""[/COLOR] [COLOR=#993333][B]OR[/B][/COLOR] [COLOR=#66cc66][[/COLOR]C2[COLOR=#66cc66]][/COLOR][COLOR=#66cc66].[/COLOR]Value [COLOR=#66cc66]=[/COLOR] [COLOR=#ff0000]"%"[/COLOR] Then
Rows[COLOR=#66cc66]([/COLOR][COLOR=#ff0000]"2"[/COLOR][COLOR=#66cc66])[/COLOR][COLOR=#66cc66].[/COLOR]EntireRow[COLOR=#66cc66].[/COLOR]Hidden [COLOR=#66cc66]=[/COLOR] True
Else
Rows[COLOR=#66cc66]([/COLOR][COLOR=#ff0000]"2"[/COLOR][COLOR=#66cc66])[/COLOR][COLOR=#66cc66].[/COLOR]EntireRow[COLOR=#66cc66].[/COLOR]Hidden [COLOR=#66cc66]=[/COLOR] False
End [COLOR=#993333][B]IF[/B][/COLOR] 
End Sub
 
Hoi,
Omdat het een Private sub is
Die moet je anders benaderen.
Groet
 
Ontzettend bedankt Harry voor de super snelle reactie. Ben er mee geholpen!

gast0660 ook Bedankt!
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan