Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi guys,
I know this is a MAC forum and I am on excel 2003 but I thought maybe someone can help... I have a button that when you click on it, it makes cell A1 duplicate what is in cell A2. But I need to have clicked on A1 before I press the button for it to work. For example if I happen to be on cell D4 and click the button, then a 0 goes in the D4 cell and nothing happens in the A1, it does not not duplicate whats in A2. I would like the D4 cell to be ignored and just have the button coded to where when I click it, regardless of where my cursor is, the A1 cell will duplicate what is in A2. I hope it is a simple line or command that I can put in the code. Thanks to anyone who can help! -maria Here is the code I have for the button now: Private Sub CommandButton1_Click() ActiveCell.FormulaR1C1 = "" ActiveCell.FormulaR1C1 = "=R[1]C" ActiveCell.Offset(1, 0).Range("A1").Select End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello Maria,
Private Sub CommandButton1_Click() Range("A1").Formula = Range("A2").value End Sub Regards, Bernd |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Bernd!!!!!!!
Thank you so much for the quick reply, it worked great! -maria "Bernd P" wrote: Hello Maria, Private Sub CommandButton1_Click() Range("A1").Formula = Range("A2").value End Sub Regards, Bernd |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Bernd again,
I was quick to say thanks before I have one more question for you... Let's say I wanted A1 to copy what is in A2 of Sheet 2 in the same workbook, how would I do that? I tried sheet2!A2 but that did not seem to work. Thanks again for you help, your great! -Maria "Maria" wrote: Hi Bernd!!!!!!! Thank you so much for the quick reply, it worked great! -maria "Bernd P" wrote: Hello Maria, Private Sub CommandButton1_Click() Range("A1").Formula = Range("A2").value End Sub Regards, Bernd |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
how about:
Sheets("sheet2").Range("A2").Copy Sheets("sheet1").Range("A1").PasteSpecial Paste:=xlPasteValues On 6 Mar, 21:16, Maria wrote: Hi Bernd again, I was quick to say thanks before I have one more question for you... Let's say I wanted A1 to copy what is in A2 of Sheet 2 in the same workbook, how would I do that? * I tried sheet2!A2 *but that did not seem to work. Thanks again for you help, your great! -Maria "Maria" wrote: Hi Bernd!!!!!!! Thank you so much for the quick reply, it worked great! -maria "Bernd P" wrote: Hello Maria, Private Sub CommandButton1_Click() Range("A1").Formula = Range("A2").value End Sub Regards, Bernd- Ukryj cytowany tekst - - Pokaż cytowany tekst - |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello Maria,
Private Sub CommandButton1_Click() Sheets("Sheet1").Range("A1").Formula = Sheets("Sheet2")Range ("A2").value End Sub Regards, Bernd |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Mar 6, 12:32*pm, Maria wrote:
Hi guys, I know this is a MAC forum and I am on excel 2003 but I thought maybe someone can help... I have a button that when you click on it, it makes cell A1 duplicate what is in cell A2. *But I need to have clicked on A1 before I press the button for it to work. *For example if I happen to be on cell D4 and click the button, then a 0 goes in the D4 cell and nothing happens in the A1, it does not not duplicate whats in A2. * I would like the D4 cell to be ignored and just have the button coded to where when I click it, regardless of where my cursor is, the A1 cell will duplicate what is in A2. I hope it is a simple line or command that I can put in the code. *Thanks to anyone who can help! *-maria Here is the code I have for the button now: Private Sub CommandButton1_Click() *ActiveCell.FormulaR1C1 = "" * * ActiveCell.FormulaR1C1 = "=R[1]C" * * ActiveCell.Offset(1, 0).Range("A1").Select End Sub worksheets("Sheet1").range("A1")=worksheets(Sheet2 ").range("A2").value |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
code question | Excel Discussion (Misc queries) | |||
vb code question | Excel Discussion (Misc queries) | |||
A macro code question from a novice | Excel Discussion (Misc queries) | |||
Another code question | Excel Discussion (Misc queries) | |||
VBA code question | Excel Discussion (Misc queries) |