Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to have a macro to so that with a push of a button, I can
move the values in cells A2:C2 to another spreadsheet (always that range). When the values are changed, I would like to be able to hit the same button and copy the new information to the next blank line on the same sheet I copied to before. I fould the following thread: http://tinyurl.com/2j9hg7 Sub copyfunction() Dim fromrng As Range Dim torng As Range With Worksheets("Sheet1") Set fromrng = .Range("a2:c2") End With With Worksheets("Sheet2") Set torng = .Cells(.Cells.SpecialCells(xlLastCell).Row + 1, "a") End With fromrng.Copy Destination:=torng End Sub This works great, but is there a way to change this so that when there is a formula in cells A2:C2, the value will copy over instead of the formula? Also, as you can tell, I am a beginner at this kind of thing, but I find myself having to rely on code more and more as I want to do more complicated things. I'd appreciate any reference books or websites that would help me learn. I don't like to just cut and paste code I don't fully understand. Any help would be appreciated. Thank You, -Chad |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
fromrng.Copy
torng.PasteSpecial xlPasteValues Application.CutCopyMode = False -- Jim wrote in message ups.com... |I would like to have a macro to so that with a push of a button, I can | move the values in cells A2:C2 to another spreadsheet (always that | range). When the values are changed, I would like to be able to hit | the same button and copy the new information to the next blank line on | the same sheet I copied to before. | | I fould the following thread: http://tinyurl.com/2j9hg7 | | Sub copyfunction() | | Dim fromrng As Range | Dim torng As Range | | With Worksheets("Sheet1") | Set fromrng = .Range("a2:c2") | End With | | With Worksheets("Sheet2") | Set torng = .Cells(.Cells.SpecialCells(xlLastCell).Row + 1, | "a") | End With | | fromrng.Copy Destination:=torng | | End Sub | | This works great, but is there a way to change this so that when there | is a formula in cells A2:C2, the value will copy over instead of the | formula? | | Also, as you can tell, I am a beginner at this kind of thing, but I | find myself having to rely on code more and more as I want to do more | complicated things. I'd appreciate any reference books or websites | that would help me learn. I don't like to just cut and paste code I | don't fully understand. Any help would be appreciated. | | Thank You, | | -Chad | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Moving cell values | New Users to Excel | |||
Moving Formulas to a different sheet | Excel Discussion (Misc queries) | |||
moving formulas from one sheet to another | Excel Discussion (Misc queries) | |||
moving values from sheet to another | Excel Discussion (Misc queries) | |||
moving values from one sheet to another | Excel Discussion (Misc queries) |