Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Create command button with VBA

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Create command button with VBA

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
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
how to create attachment command button gbpg Excel Discussion (Misc queries) 0 August 15th 07 02:44 PM
Wanting to Create A Command Button Command bumper338 Excel Programming 3 May 7th 07 06:53 PM
Create a command button in Excel using C# Senthil[_2_] Excel Programming 0 December 27th 06 01:52 PM
How to Create a Command Button Jason Excel Discussion (Misc queries) 1 October 12th 05 09:50 PM
Create Command Button from Code Bruce B[_2_] Excel Programming 0 July 14th 03 02:01 PM


All times are GMT +1. The time now is 10:36 PM.

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"