reports forms coding

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Reports forms coding

Reports forms coding

resolvedResolved · High Priority · Version 2010

Martin has attended:
Excel Advanced course
Excel Advanced - Formulas & Functions course
Excel Advanced - For Power Users course
Excel VBA Intro Intermediate course
Excel VBA Advanced course

Reports forms coding

Hi Support,

I have written a large procedure that I would like to execute once I have received some user input information. For this I have created a form, which opens as soon as the excel document is opened. The user enters the data required, clicks the OK command button and the data is returned to the excel document. I then have a command to unload the form. As soon as this is done, I then want to call the procedure I have written. For some reason I cannot seem to call the procedure from the code in the form. Please see below:-

Private Sub cmdOK_Click()

Load StyleImportForm

Dim tb1 As Range
Dim tb2 As Range
Dim tb3 As Range

Set tb1 = Sheets("SeasonCodeTable").Range("F2")
Set tb2 = Sheets("SeasonCodeTable").Range("F3")
Set tb3 = Sheets("SeasonCodeTable").Range("F4")

tb1.Value = TextBox1.Value
tb2.Value = TextBox2.Value
tb3.Value = TextBox3.Value / 100

Unload StyleImportForm

Call ScotchStyleImport

End Sub

Private Sub UserForm_Initialize()


TextBox1.Value = "0.00"
TextBox2.Value = "0.00"
TextBox3.Value = "0"


End Sub


Any ideas why this is not working.

Thanks

Martin

RE: Reports forms coding

Hi Martin

Good to hear from you again. I can't think of a reason why the ScotchStyleImport routine wouldn't fire, so something's happening there.

It's difficult to debug routines inside a form; does the routine work if you execute it standalone (not inside the form)?

If it does, create a breakpoint on the Call line. To do this click inside the line of code and press F9. When the event next happens the execution will freeze at that line. You can then perform a Step Through (F5) to work out whether the event is even occurring.

That should uncover the issue - then we can tackle that!

Kind regards

Gary Fenn
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Wed 3 Jul 2013: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Status Bar Functions

When using the SUM, MIN, MAX, AVERAGE and COUNT functions, the result of such calculations are displayed in the worksheet.

However, if a range of cells, containing numbers, is highlighted, and then a right-mouse click is performed at the bottom right side of the status bar, then the result of those functions will be displayed.

View all Excel hints and tips


Server loaded in 0.08 secs.