PC Review


Reply
Thread Tools Rate Thread

Create command button with VBA

 
 
Les
Guest
Posts: n/a
 
      10th Dec 2007
Hi All, i have a report that i delete the old sheet and replace it with a new
one. What i would like to do is create a command button with VBA and place it
on the new sheet (ALL LC PARTS) and it must have a comment "BACK" on it the
code for this button would also have to go into the new sheet module.

Any help on this would be much appreciated.
--
Les
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      10th Dec 2007
Sub test()
Sheets("ALL LC PARTS").Delete
Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = "ALL LC PARTS"

Set newbutton = ActiveSheet.OLEObjects.Add( _
ClassType:="Forms.CommandButton.1", _
Link:=False, _
DisplayAsIcon:=False, _
Left:=227.25, _
Top:=219, _
Width:=72, _
Height:=24)
newbutton.Object.Caption = "Back"

End Sub


"Les" wrote:

> Hi All, i have a report that i delete the old sheet and replace it with a new
> one. What i would like to do is create a command button with VBA and place it
> on the new sheet (ALL LC PARTS) and it must have a comment "BACK" on it the
> code for this button would also have to go into the new sheet module.
>
> Any help on this would be much appreciated.
> --
> Les

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a command button diepvic Microsoft Excel Programming 3 27th Jun 2009 01:33 PM
Wanting to Create A Command Button Command =?Utf-8?B?YnVtcGVyMzM4?= Microsoft Excel Programming 3 7th May 2007 06:53 PM
How to create a command button to do... =?Utf-8?B?a2lt?= Microsoft Access Forms 3 27th Jul 2006 05:52 PM
How to Create a Command Button =?Utf-8?B?SmFzb24=?= Microsoft Excel Misc 1 12th Oct 2005 09:50 PM
Create Command Button =?Utf-8?B?RXJpY2EgVS4=?= Microsoft Word Document Management 2 28th Apr 2004 07:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:37 AM.