Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default user forms coding help


i am working on a userform using vb editor. i would like to have the
users print and save the form. i need a code to accomplish both.
thanks


--
dstyles782001
------------------------------------------------------------------------
dstyles782001's Profile: http://www.excelforum.com/member.php...o&userid=31727
View this thread: http://www.excelforum.com/showthread...hreadid=514390

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default user forms coding help

What do you mean by Save the form?


You can use Userform1.printform

if that doesn't give you what you want, then you can get a copy of the
userform as a graphic and place it on a worksheet. Then manipulate it as
you need; then print it out.

Here is code that will print a userform as a graphic on a worksheet:


Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

'Public Const VK_SNAPSHOT = &H2C

Public Const VK_SNAPSHOT = 44
Public Const VK_LMENU = 164
Public Const KEYEVENTF_KEYUP = 2
Public Const KEYEVENTF_EXTENDEDKEY = 1


Sub Test()
UserForm1.Show
End Sub


In the userform module:




Private Sub CommandButton1_Click()
' keybd_event VK_SNAPSHOT, 0, 0, 0
DoEvents
keybd_event VK_LMENU, 0, _
KEYEVENTF_EXTENDEDKEY, 0 ' key down
keybd_event VK_SNAPSHOT, 0, _
KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, _
KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, _
KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")
ActiveSheet.PasteSpecial Format:="Bitmap", _
Link:=False, DisplayAsIcon:=False
ActiveSheet.Range("A1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Close False
End Sub

--
Regards,
Tom Ogilvy


"dstyles782001"
wrote in message
news:dstyles782001.23j5wz_1140443101.6881@excelfor um-nospam.com...

i am working on a userform using vb editor. i would like to have the
users print and save the form. i need a code to accomplish both.
thanks


--
dstyles782001
------------------------------------------------------------------------
dstyles782001's Profile:

http://www.excelforum.com/member.php...o&userid=31727
View this thread: http://www.excelforum.com/showthread...hreadid=514390



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default user forms coding help


when the users receive the form i want them to submit it back to me. I
am trying to write a code for submit but i'm still having issues can yu
assist


--
dstyles782001
------------------------------------------------------------------------
dstyles782001's Profile: http://www.excelforum.com/member.php...o&userid=31727
View this thread: http://www.excelforum.com/showthread...hreadid=514390

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default user forms coding help

Generally, a userform is used as an interface and the data entered then
moved to a worksheet.


http://support.microsoft.com/default.aspx?kbid=161514
XL97: How to Use a UserForm for Entering Data

http://support.microsoft.com/default.aspx?kbid=213749
XL2000: How to Use a UserForm for Entering Data

--
Regards,
Tom Ogilvy


"dstyles782001"
wrote in message
news:dstyles782001.23jcuz_1140452102.5849@excelfor um-nospam.com...

when the users receive the form i want them to submit it back to me. I
am trying to write a code for submit but i'm still having issues can yu
assist


--
dstyles782001
------------------------------------------------------------------------
dstyles782001's Profile:

http://www.excelforum.com/member.php...o&userid=31727
View this thread: http://www.excelforum.com/showthread...hreadid=514390



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
Date and User restriction coding PSM[_19_] Excel Worksheet Functions 1 November 19th 09 07:03 PM
User Form Coding bern Excel Discussion (Misc queries) 0 September 6th 05 04:51 PM
User-changeable paths into Excel - avoid hard coding gearoi[_3_] Excel Programming 11 August 31st 05 03:10 PM
Efficient User Form vba coding for saving to worksheet Cheryl Excel Programming 1 July 23rd 04 02:07 PM
User Forms Sgwapt Excel Programming 5 June 26th 04 09:36 AM


All times are GMT +1. The time now is 05:27 PM.

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"