View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Transfer cell values to another cell by selecting button.

hi
open the control toolbox and drop a command button on the sheet. place it
where you wish. while in design mode, right cllick the command button and
from the popup, select view code.
if the button is already there then open the toolbox and click on the design
mode icon. looks like a protractor with pencil and ruler.
the click event is the default command button event so the
commandbutton1_click should default when you selec view code. paste this code
in...
'Private Sub CommandButton1_Click() ' this like should default
Dim r As Range
Dim ro As Range
Set r = Range("E6")
Set ro = Range("F6")
ro.Value = r.Value

'End Sub ' this like should default

so that each time you click the button, the value of E6 will transfer to F6.
is that what you wanted?

regards
FSt1

"Gryndar" wrote:

I would like to be able to select a 'Button' within a cell or beside a cell
to send the contents of that cell to another cell. The Control Toolbox has a
Command Button but I do not know how to set it up. *The Cell in question has
a formula to retrieved info from another sheet.* I have tried to set up a
Macro for a small triangle put into the cell but I am new to Macros and can't
seem to get it to work properly.

Cell contains: =Players!C2

Macro I used was:

Sub MoveData()
Range("E6").Copy Range("F6")
End Sub

(E6 has formula: =Players!C2 )

I want to be able to click on that cell or a button or object in or beside
the cell that will then transfer that cell value to another cell on same
sheet.