PDA

View Full Version : userform apply code after userform end



danovkos
09-25-2009, 01:58 AM
hi all,
pls. i want to create simply userform, which will run my codes, based checked checkboxes in userform.
I found this great example
http://www.vbaexpress.com/kb/getarticle.php?kb_id=171
but those checkbox run command (msgbox) immediately. But i want it after clicking on command button.

Pls. how to do it?
thx a lot

Bob Phillips
09-25-2009, 02:04 AM
Just ditch the checkbox click events.

That code shows you how to test the value oif the checkboxes, whether checked or not, in its button click event (button 2).

danovkos
09-25-2009, 02:14 AM
sorry i don know if i good understud

with "dich" you mean...improve checkbox code?

i tried something like this, but it works immediately again


Private Sub CheckBox1_Click()
If UserForm1.CheckBox2.Value = True Then
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'Y:\W\FOLDER1\only\[VIEW2009.xls]piv all'!R5C1:R3000C95,13,0)"
Selection.Copy
End Sub


how to tell him, that it have to runs after userforms i ended by commandbutton1?

Bob Phillips
09-25-2009, 02:25 AM
By ditch I mean 'get rid of', delete them if you don't want anything to happen immediately when you click the checkbox.

danovkos
09-25-2009, 02:33 AM
OK
now it works.
I dont know why..but i tried something like this before, but it doesnt works...
Maybe was something wrong.
Now it works great.
thx for help