Return to module after userform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Y'all are gonna get so tired of me...

OK - with my error question earlier today, I need to call a userform, enter
data, and return to processing the rest of the data. Problem is, when I click
OK on the form, it unloads the form and stops processing. Basically, it
terminates the module. How do I get it to continue processing after clicking
OK?

Right now, it relies on the BTNok_Click() event to process the data. Is this
bad?
 
I would set a break point in the macro and then step through the code to find
the problem.

Open VBA editor and press F9 on first line of code (nmot CONST or DIM
statements).

Then go back to excel spreadsheet and activate macro. Use F8 to step
through code to locate the problem.
 
You need to show the form from within your procedure, with extra code the
executes upon return from the userform.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Thanks, Joel.

Tried that. After it unloads the form, it just returns to the sheet.

The problem is that occasionally faulty data comes in and crashes my macro.
This is to catch the faulty data, ask for input and continue processing
anyway.
 
This is what I've got:
If IsError(.Cells(ediro,40)) = True Then
If .Cells(ediro,40).Value = CVError(xlErrNA) Then
With Form_VacRate
.TBempname = empname
.TBfilenum = empnum
.Show
End With
End If
End If

Should I not rely on the Click() event? Simply continue processing after the
..Show?
--
Adios,
Clay Harryman


Bob Phillips said:
You need to show the form from within your procedure, with extra code the
executes upon return from the userform.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
hi,
I didn't read your error question earlier. sorry. perhaps you need keep your
posts within the thread.
anyway...
with event driven programing, programmers sometimes have to do funny song
and dance routines to make the whole show work right.
try busting your macro in 2. the end of the first would call the form. a
button's click event on the form might call the rest of the macro.
just a suggestion.

regards
FSt1
 
I've considered it. it's uglier than what I want to do, but it will work.

Thanks!

When I originally posted, I didn't think the error code was pertinent to
this question. Sorry!
 
Found the answer. I'm gonna use INPUTBOX rather than the form. It resolves
the issue quite nicely.

Thanks for all your help. I would still like to know how Joel's answer
works, though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top