#1   Report Post  
Posted to microsoft.public.excel.misc
CP CP is offline
external usenet poster
 
Posts: 64
Default Programming commands

I have just added a couple of buttons to my work book and i wish them to
carry out two tasks
The 2 buttons are on sheet1

1) print sheet3 to default printer
2) close excel without saving or asking to

I am ok with getting to the coding screen however I just dont know what to
write in the visual basic box to perform the tasks

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default Programming commands

1.
Sheets("sheet3").PrintOut (beware of the case)
2.
Application.DisplayAlerts = False
Application.Quit
--
Regards.
Daniel
"CP" a écrit dans le message de news:
...
I have just added a couple of buttons to my work book and i wish them to
carry out two tasks
The 2 buttons are on sheet1

1) print sheet3 to default printer
2) close excel without saving or asking to

I am ok with getting to the coding screen however I just dont know what to
write in the visual basic box to perform the tasks

Thank you



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default Programming commands

Hi

With the two buttons named CommandButton1 and 2 insert theese two
macros in the codesheet for sheet1

Private Sub CommandButton1_Click()
Sheets("Sheet3").PrintOut
End Sub

Private Sub CommandButton2_Click()
ThisWorkbook.Close Savechanges = False
End Sub

Regards,
Per

On 15 Okt., 12:15, CP wrote:
I have just added a couple of buttons to my work book and i wish them to
carry out two tasks
The 2 buttons are on sheet1

1) print sheet3 to default printer
2) close excel without saving or asking to

I am ok with getting to the coding screen however I just dont know what to
write in the visual basic box to perform the tasks

Thank you


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
vba programming biker man Excel Discussion (Misc queries) 1 August 28th 07 04:02 PM
programming help biker man Excel Discussion (Misc queries) 2 July 22nd 07 11:54 PM
programming help Stan Excel Discussion (Misc queries) 2 April 23rd 07 02:44 PM
CD Programming nelson Excel Discussion (Misc queries) 0 June 4th 06 04:32 PM
Programming help BB Excel Discussion (Misc queries) 3 December 5th 05 01:09 AM


All times are GMT +1. The time now is 11:04 AM.

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

About Us

"It's about Microsoft Excel"