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

creating report template through

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Creating a report template through Excel VBA Forms

Creating a report template through Excel VBA Forms

ResolvedVersion 2019

Creating a report template through Excel VBA Forms

Hello,

I want to create a report so users can select what fields they want to extract data, similar to Pivot but more user friendly.

Users can select which fields they want and it will run.

Data is also in different tabs, can this be done through 'Forms'?

Regards
Yiota

RE: Creating a report template through Excel VBA Forms

Hi Yiota,

Yes, this is very possible.

You can give your users a user form and use options, checkboxes or multiselect list boxes to select what they want to be included in their report.

Once the user presses OK you can use IF THEN ELSE or Select Case to determine which actions match those selections.

If you can express the logic then you can create the report using a User Form to choose what is included.

Are you creating the report from scratch? Where is your original data? Are you selecting the data and copying to an empty sheet?

Please let me know if you need further help. I suspect that building the user form is the easier part of this problem.

thanks
Claire

RE: Creating a report template through Excel VBA Forms

Hi Claire

Thanks for this, can you please just give me the code. For example, data is in column A and I want to link the command / filter to that column and return the data, selected range from form, like a date range.

That's where I'm getting confused.

Thank you!
Yiota

RE: Creating a report template through Excel VBA Forms

Hi Yiota,

You're going to need something like this on your OK button:

======
Private Sub cmdOK_Click()

If optFirst = True Then

Range(Range("A1"), Selection.End(xlDown)).Copy Range("H1")

End If

Unload UserForm1

End Sub
======

This is working on the assumption that the selection related to optFirst is found in A1 and you'd select all the way to the bottom of that range. Then you copy it to another location, H1 in the example.
As I don't know what your spreadsheet looks like I can't be more specific.
Hope this helps.

Claire

Will be marked as resolved in 5 days

Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.

Tue 10 Mar 2020: 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:

Adding multiple rows in an Excel 2010 Worksheet

If you want to add more than one row to an Excel Worksheet, drag select the number or rows you want added to the spreadsheet.

Then right click on these selected rows, choose Insert from the menu, and the new rows will be added above the rows you first selected.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.