Adding Command buttins by macro

S

Stu

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
 
S

Simon Lloyd

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

Stu;188991 said:
Hi there all...

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

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

Look forward to some kind soul's help..

St

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
J

JLGWhiz

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
 
Top