change boolean value to skip part in second macro

littlepete

Well-known Member
Joined
Mar 26, 2015
Messages
503
Office Version
  1. 365
Platform
  1. Windows
hello :)
ik wil mijn macro "datumfilter" starten zodra excel geopend wordt. en als deze start wil ik één bepaalde setting op 9 zetten voor deze tweede macro start.

ik heb in de auto_open een boolean waarde "autox" toegevoegd en op het einde dit gezet:
autox = true ' check of excel pas geopend werd
call datumfilter ' de tweede macro die hierna moet starten

in de tweede macro "datumfilter" staat dan direct na de twee invulvragen (values keuze en antwoord, deze lijn:
if autox = true then keuze = 9
op het einde van de macro staat dan : " If auto = True Then auto = Not auto "

die eerste lijn "if autox..." lukt niet, de foutmelding is deze:
"compileerfout: toewijzing aan constante is niet toegestaan"

wat doe ik fout?
thx !!!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
In de module met datumfilter bovenaan plaatsen: Public autox As Boolean
 
Upvote 0
真的是中国话... wat moet ik daarmee?
de "public autox as boolean" staat er in module 1 bovenaan.
is het van belang in welke module de macro's staan om de boolean te laten werken?
en waarom krijg ik die foutmelding ik denk dat de formule toch echt zo werkt : "If auto = True Then auto = Not auto"
of moet dat anders?
 
Upvote 0
Kan ook zijn dat keuze verkeerd gedeclareerd is.
 
Upvote 0
de variable keuze staat als variant genoteerd ... mogelijke antwoorden zijn 0 tem. 9 :)
 
Upvote 0
keuze verkeerd gedeclareerd ??? moet ik met een mercedes binnenrijden? ik snap er nixxx van :(
 
Upvote 0

Forum statistics

Threads
1,215,807
Messages
6,127,002
Members
449,351
Latest member
Sylvine

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