Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How to Copy the value of a cell to any given cell
How to copy the Value of a cell just by clicking on that cell and having its
value pop on another cell. For example: A1=15, upon clicking on this cell, i would like the value to post on cell b1. What I am doing is displaying a monthly calendar, to the right of the last day of the week I have a blank cell where I currently type which day of the week someone received a paycheck and then next to this cell I enter the value of the paycheck. It would be nice just to click on the date and have it copy to the blank cell. I tried creating command button overlayed on top of the cell with the value and having it post the value to the blank cell, but my expertise is challenged by lack of knowing more programing language. Thank you |
#2
|
|||
|
|||
How to Copy the value of a cell to any given cell
This is what I typed in the VBA part of the cmd Button, I just hate the
thought of having to replicate this formula 365 times. Could there be an easier way and also some way that will take less MB to create? Private Sub CommandButton1_Click() Range("S12").Select Selection.Copy Range("U12").Select ActiveSheet.Paste Application.CutCopyMode = False End Sub "Memphis" wrote: How to copy the Value of a cell just by clicking on that cell and having its value pop on another cell. For example: A1=15, upon clicking on this cell, i would like the value to post on cell b1. What I am doing is displaying a monthly calendar, to the right of the last day of the week I have a blank cell where I currently type which day of the week someone received a paycheck and then next to this cell I enter the value of the paycheck. It would be nice just to click on the date and have it copy to the blank cell. I tried creating command button overlayed on top of the cell with the value and having it post the value to the blank cell, but my expertise is challenged by lack of knowing more programing language. Thank you |
#3
|
|||
|
|||
How to Copy the value of a cell to any given cell
You want to process one row at a time--not all 365 rows all at once?
If yes, then I would use one button and put it in Row 1--then freeze row 1 so that it's always visible. Then you could select the row you want processed and then click the button. (putting 365 buttons wouldn't appeal to me, either) Private Sub CommandButton1_Click() dim myRow as long myrow = activecell.row me.cells(myRow,"S").copy _ destination:=me.cells(myrow,"U") application.cutcopymode = false end sub There's nothing built into excel that will catch your clicking--but you could catch the doubleclick or rightclicking on a cell. If one of those appeals to you, post back. Memphis wrote: This is what I typed in the VBA part of the cmd Button, I just hate the thought of having to replicate this formula 365 times. Could there be an easier way and also some way that will take less MB to create? Private Sub CommandButton1_Click() Range("S12").Select Selection.Copy Range("U12").Select ActiveSheet.Paste Application.CutCopyMode = False End Sub "Memphis" wrote: How to copy the Value of a cell just by clicking on that cell and having its value pop on another cell. For example: A1=15, upon clicking on this cell, i would like the value to post on cell b1. What I am doing is displaying a monthly calendar, to the right of the last day of the week I have a blank cell where I currently type which day of the week someone received a paycheck and then next to this cell I enter the value of the paycheck. It would be nice just to click on the date and have it copy to the blank cell. I tried creating command button overlayed on top of the cell with the value and having it post the value to the blank cell, but my expertise is challenged by lack of knowing more programing language. Thank you -- Dave Peterson |
#4
|
|||
|
|||
How to Copy the value of a cell to any given cell
Thank you Dave for posting your reply.
What I have done is: Designed a monthly calendar Sun-Sat the months are laid out like this: JAN APR FEB MAY MAR JUN so that upon print out one can see one whole semester. Each cell has the day date on it (text) At the right of Saturday's day date there is a blank cell where manually I have to type in the day the person got paid that month Currenthly I have placed a cmd button on top of the cell making it transparent upon clicking it it copies the value of the cell it is on top of and pastes it to the blank cell. (see code for cmd button on previous post). So far I have only created the 1st semester for 2004 and it is taking forever. I am interested in knowing how by double clicking on the cell i could have this done. please let me know. Thank you "Dave Peterson" wrote: You want to process one row at a time--not all 365 rows all at once? If yes, then I would use one button and put it in Row 1--then freeze row 1 so that it's always visible. Then you could select the row you want processed and then click the button. (putting 365 buttons wouldn't appeal to me, either) Private Sub CommandButton1_Click() dim myRow as long myrow = activecell.row me.cells(myRow,"S").copy _ destination:=me.cells(myrow,"U") application.cutcopymode = false end sub There's nothing built into excel that will catch your clicking--but you could catch the doubleclick or rightclicking on a cell. If one of those appeals to you, post back. Memphis wrote: This is what I typed in the VBA part of the cmd Button, I just hate the thought of having to replicate this formula 365 times. Could there be an easier way and also some way that will take less MB to create? Private Sub CommandButton1_Click() Range("S12").Select Selection.Copy Range("U12").Select ActiveSheet.Paste Application.CutCopyMode = False End Sub "Memphis" wrote: How to copy the Value of a cell just by clicking on that cell and having its value pop on another cell. For example: A1=15, upon clicking on this cell, i would like the value to post on cell b1. What I am doing is displaying a monthly calendar, to the right of the last day of the week I have a blank cell where I currently type which day of the week someone received a paycheck and then next to this cell I enter the value of the paycheck. It would be nice just to click on the date and have it copy to the blank cell. I tried creating command button overlayed on top of the cell with the value and having it post the value to the blank cell, but my expertise is challenged by lack of knowing more programing language. Thank you -- Dave Peterson |
#5
|
|||
|
|||
How to Copy the value of a cell to any given cell
Rightclick on the worksheet tab that should have this behavior. (It's gonna go
in the same module as the code for the commandbuttons from the control toolbox.) Option Explicit Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _ Cancel As Boolean) If Intersect(Target, Me.Range("S:S")) Is Nothing Then Exit Sub End If Target.Copy _ Destination:=Me.Cells(Target.Row, "U") Application.CutCopyMode = False Cancel = True 'to stop direct edit in cell (if it's turned on End Sub There's a Worksheet_BeforeRightClick event that you could tie into, too. The code between "sub" and "end sub" would look the same (although the cancel=true line would stop the rightclick menu from popping up.) Memphis wrote: Thank you Dave for posting your reply. What I have done is: Designed a monthly calendar Sun-Sat the months are laid out like this: JAN APR FEB MAY MAR JUN so that upon print out one can see one whole semester. Each cell has the day date on it (text) At the right of Saturday's day date there is a blank cell where manually I have to type in the day the person got paid that month Currenthly I have placed a cmd button on top of the cell making it transparent upon clicking it it copies the value of the cell it is on top of and pastes it to the blank cell. (see code for cmd button on previous post). So far I have only created the 1st semester for 2004 and it is taking forever. I am interested in knowing how by double clicking on the cell i could have this done. please let me know. Thank you "Dave Peterson" wrote: You want to process one row at a time--not all 365 rows all at once? If yes, then I would use one button and put it in Row 1--then freeze row 1 so that it's always visible. Then you could select the row you want processed and then click the button. (putting 365 buttons wouldn't appeal to me, either) Private Sub CommandButton1_Click() dim myRow as long myrow = activecell.row me.cells(myRow,"S").copy _ destination:=me.cells(myrow,"U") application.cutcopymode = false end sub There's nothing built into excel that will catch your clicking--but you could catch the doubleclick or rightclicking on a cell. If one of those appeals to you, post back. Memphis wrote: This is what I typed in the VBA part of the cmd Button, I just hate the thought of having to replicate this formula 365 times. Could there be an easier way and also some way that will take less MB to create? Private Sub CommandButton1_Click() Range("S12").Select Selection.Copy Range("U12").Select ActiveSheet.Paste Application.CutCopyMode = False End Sub "Memphis" wrote: How to copy the Value of a cell just by clicking on that cell and having its value pop on another cell. For example: A1=15, upon clicking on this cell, i would like the value to post on cell b1. What I am doing is displaying a monthly calendar, to the right of the last day of the week I have a blank cell where I currently type which day of the week someone received a paycheck and then next to this cell I enter the value of the paycheck. It would be nice just to click on the date and have it copy to the blank cell. I tried creating command button overlayed on top of the cell with the value and having it post the value to the blank cell, but my expertise is challenged by lack of knowing more programing language. Thank you -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to count the number of text frequencies and copy to other cell | Excel Worksheet Functions | |||
hpw do I logic test a cell then copy the row to diff. SS | Excel Worksheet Functions | |||
How can I copy cell formats in functions? | Excel Worksheet Functions | |||
cell color index comparison | New Users to Excel | |||
How do I copy data in single cell format to a merged cell format | Excel Discussion (Misc queries) |