Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Adding Command buttins by macro

Hi there all....

Is it possible to add a command button INTO A CELL by macro - I'm OK with
writing the code, assigning it etc, but I want to add rows to a worksheet,
each of which requires a command button in the appropriate cell in column H.

Searched high and low through help, forums and newsgroups, so now I'm
writing to one.

Look forward to some kind soul's help...

Stu



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding Command buttins by macro


Why a command button, you could end up with hundreds!, what would the
button be for?, because you could have one button that only runs the
macro for the active row if thats what you want!

Stu;188991 Wrote:
Hi there all....

Is it possible to add a command button INTO A CELL by macro - I'm OK
with
writing the code, assigning it etc, but I want to add rows to a
worksheet,
each of which requires a command button in the appropriate cell in
column H.

Searched high and low through help, forums and newsgroups, so now I'm
writing to one.

Look forward to some kind soul's help...

Stu



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52105

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Adding Command buttins by macro

Command buttons cannot be embedded into a cell on a worksheet. All controls
are added on a different object level than the worksheet. However, here is
code for adding an OLEObject command button.

Dim ws As Worksheet
With ws
Set Btn = .OLEObjects.Add(ClassType:="Forms.CommandButton.1" , _
Left:=.Range("C3").Left, Top:=.Range("C3").Top, Width:=100, Height:=30)
End With

"Stu" wrote:

Hi there all....

Is it possible to add a command button INTO A CELL by macro - I'm OK with
writing the code, assigning it etc, but I want to add rows to a worksheet,
each of which requires a command button in the appropriate cell in column H.

Searched high and low through help, forums and newsgroups, so now I'm
writing to one.

Look forward to some kind soul's help...

Stu




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
Adding a Dos command in EXCEL Gareth - Network analyst. Excel Discussion (Misc queries) 10 June 23rd 06 12:56 PM
command for adding value in excel sheet [email protected] Excel Programming 1 May 10th 06 08:09 PM
adding a right click command? Matt Excel Programming 3 December 5th 05 06:19 PM
OnAction - Adding a command bar DejaVu[_8_] Excel Programming 4 June 6th 05 04:34 PM
Adding a command button Roy Thompson Excel Programming 2 October 4th 04 10:12 PM


All times are GMT +1. The time now is 05:58 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"