View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Copy Push Button and VB Functionality

if you use a push button from the forms toolbar, you can assign a single
macro to each button.

Public Sub pButton_Click()
Dim rng as Range, rw as Long
Dim sName as String, btn as Button
sName = Application.Caller
set btn = Activesheet.buttons(sname)
set rng = btn.TopLeftCell ' or .BottomRightCell
rw = rng.row
msgbox sname & ": " & rng.Address(0,0)
End Sub

as an example.

--
Regards,
Tom Ogilvy


"SystemParametersInfo -Kokomo" wrote:

I am new to using VB with excel, so please be gental. I am trying to
duplicat a push button that was created for one row of cells. I want all
other rows of cells to have their own push buton with the same funcationality
only using the data from their row and output to their row. How can this be
done without creating each buttno and its VB code from scratch?

Like when you select a funtion and copy it to other cells. The function is
moved and then the cells that it is usnign are updated with the move.

Is there a way to attach a Push Button to a cell and then have the cells
location as an input parameter to the VB init?

Thanks,
Jeff