A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Transfer cell values to another cell by selecting button.



 
 
Thread Tools Display Modes
  #1  
Old November 24th 08, 01:02 AM posted to microsoft.public.excel.worksheet.functions
Gryndar
external usenet poster
 
Posts: 12
Default Transfer cell values to another cell by selecting button.

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.
Ads
  #2  
Old November 24th 08, 02:12 AM posted to microsoft.public.excel.worksheet.functions
Corey[_3_]
external usenet poster
 
Posts: 25
Default Transfer cell values to another cell by selecting button.

Try using something like:
Sub MoveData()
If Range("G6").value <>"" then Range("A1").value = Range("G6").value
' Modify the A1 to the required cell.
End Sub


I prefer a Forms Button from the Forms Toolbar.

1). Copy the code between the Sub and End Sub
2). Ad the Forms Button to the sheet where you want it
3). You will be prompted to attach a macro
4). Select New
5). Paste the copied code to the New macro
ALT+Q to exit VBA.

Corey....

"Gryndar" > wrote in message
...
>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.



  #3  
Old November 24th 08, 02:21 AM posted to microsoft.public.excel.worksheet.functions
FSt1
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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transfer specific characters from cell to another cell. Willing to learn New Users to Excel 3 June 17th 07 02:14 AM
Automating cell to transfer to another cell WANTED Excel Discussion (Misc queries) 1 May 23rd 07 04:27 PM
Conditional Save button, Auto refresh, and cell transfer newguyA14 Excel Discussion (Misc queries) 0 April 10th 07 07:56 PM
Enter value in cell by selecting cell. Greyson Excel Discussion (Misc queries) 2 November 2nd 06 12:01 AM
Selecting items from a list. To transfer to another worksheet? Mountain goat Excel Discussion (Misc queries) 0 September 19th 05 06:06 PM


All times are GMT +1. The time now is 01:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.