Print Active Form

Nomis_Eswod

Board Regular
Joined
Jul 27, 2005
Messages
153
Hi,

I want to do a macro that will print forms that I have created in Excel. However, instead of doing a macro for each form, I was wondering if there was a way to print the active form, whichever one it is. So was thinking something like

Code:
Sub Print()
ActiveForm.Print
End Sub

That doesn't work, so wondered if there was anyway of doing this?
 

Some videos you may like

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,052
Office Version
  1. 365
Platform
  1. Windows
By forms do you mean userforms?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,052
Office Version
  1. 365
Platform
  1. Windows
If there is only 1 userform active try this.
Code:
UserForms(0).PrintForm
 

Nomis_Eswod

Board Regular
Joined
Jul 27, 2005
Messages
153

ADVERTISEMENT

Excellent, thanks!

Went for the Me.PrintForm in the end!
 

Watch MrExcel Video

Forum statistics

Threads
1,118,291
Messages
5,571,331
Members
412,382
Latest member
Langtn02
Top