Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mully
 
Posts: n/a
Default Printing a User Form

I have a user form using columns A-V in Excel which scrolls down to Row 200.
Each row contains customer details in the colums A to V e.g, Name/Address/
Contact Numbers/ Age etc. As I scroll down the list of custermers their
details appear in the relevant boxes on the User Form. Is it possible when a
customers details fill in the relevant boxes that I can print the User Form
with just their details. I hane placed a Command Button ( Print ) on the User
Form however cannot get it to print. Any help would be much appreciated.
  #2   Report Post  
Jan Karel Pieterse
 
Posts: n/a
Default

Hi Mully,

I hane placed a Command Button ( Print ) on the User
Form however cannot get it to print.


Doesn't:

UserForm1.PrintForm

work?

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

  #3   Report Post  
mully
 
Posts: n/a
Default

Thanks for prompt answer - however I may have phrased the query wrong. I can
get the user form to print when I open it in VBA mode with the statement
UserForm1.PrintForm but when the User Form opens in Excel sheet ( Customers )
and all their details enter the various boxes for that particular customer it
will not print that user form with the customers details. Does that explain
it better???

Regards Mully.

"Jan Karel Pieterse" wrote:

Hi Mully,

I hane placed a Command Button ( Print ) on the User
Form however cannot get it to print.


Doesn't:

UserForm1.PrintForm

work?

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com


  #4   Report Post  
Jan Karel Pieterse
 
Posts: n/a
Default

Hi Mully,

Thanks for prompt answer - however I may have phrased the query wrong. I can
get the user form to print when I open it in VBA mode with the statement
UserForm1.PrintForm but when the User Form opens in Excel sheet ( Customers )
and all their details enter the various boxes for that particular customer it
will not print that user form with the customers details. Does that explain
it better???


It works fine for me. I just tried by using a simple form with a button and an
editbox with the following code attached to the button:

Private Sub CommandButton1_Click()
Me.PrintForm
End Sub

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

  #5   Report Post  
mully
 
Posts: n/a
Default

Hi Jan,
Thanks for all your help still struggling inserted following code in to VBA

' This is the click event for UserForm1
Private Sub CommandButton510_Click()
UserForm1.PrintForm
End Sub

all it does is print the user form in VBA mode and not the excel mode with
all members details in the boxes. I inherited the program and being a new
user to excel
find it difficult to write the necessary code to print the form when it
activates in excel - does this explanation help????

Cheers Mully

"Jan Karel Pieterse" wrote:

Hi Mully,

Thanks for prompt answer - however I may have phrased the query wrong. I can
get the user form to print when I open it in VBA mode with the statement
UserForm1.PrintForm but when the User Form opens in Excel sheet ( Customers )
and all their details enter the various boxes for that particular customer it
will not print that user form with the customers details. Does that explain
it better???


It works fine for me. I just tried by using a simple form with a button and an
editbox with the following code attached to the button:

Private Sub CommandButton1_Click()
Me.PrintForm
End Sub

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com




  #6   Report Post  
Jan Karel Pieterse
 
Posts: n/a
Default

Hi Mully,

find it difficult to write the necessary code to print the form when it
activates in excel - does this explanation help????


What do you mean by "activates in Excel"?

The code I gave you should be tied to a command button that is on the
userform itself. You can access the code of a button (or any other
control) from the VBE by double clicking the control in the userform's
design window.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

  #7   Report Post  
mully
 
Posts: n/a
Default

Hi Jan,

Absolutely brilliant - I just wrote the code not knowing that the command
button was on another sheet with your explanation of clicking twice on the
button in VBA it threw me on to the right sheet and code - just added
UserForm1.PrintForm in the correct place and it worked perfectly. Thank you
again

Regards

Mully

"Jan Karel Pieterse" wrote:

Hi Mully,

find it difficult to write the necessary code to print the form when it
activates in excel - does this explanation help????


What do you mean by "activates in Excel"?

The code I gave you should be tied to a command button that is on the
userform itself. You can access the code of a button (or any other
control) from the VBE by double clicking the control in the userform's
design window.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing a workbook one row at a time filling in a form with the d LostinData New Users to Excel 1 May 6th 05 08:16 PM
opening a user form maxzsim Excel Worksheet Functions 2 May 4th 05 10:03 AM
user form static69 Excel Discussion (Misc queries) 1 February 6th 05 08:43 PM
Data Entry Alert in User Form Kev Excel Discussion (Misc queries) 6 January 8th 05 03:01 PM
A "previous" button on a user form Anthony Slater Excel Discussion (Misc queries) 3 November 29th 04 05:57 PM


All times are GMT +1. The time now is 09:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"