Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using variables when copying values between worksheets
Hello! I am trying to copy values between two worksheets. On the
second worksheet I want to allow users to be able to see scenarios asa the numbers change. So when the user clicks a command button for the first copy we have original values. For the second copy the values will be different. Yet I am having a problem that I can't seem to capture only the value. I read that PasteSpecial should do the trick .... yet I am using variables to pass the columns that I happen to be working with. With the following I get an error. Any tips or clues? Thanks in advance. Worksheets("Sheet1").Cells(5,12).Copy Sheets("Sheet2").Range(Cells(8, EmptyColumn), Cells _(8,EmptyColumn+1).PasteSpecial Paste:=xlPasteFormats Sheets("Sheet2").Range(Cells(8, EmptyColumn), Cells _(8,EmptyColumn+1).PasteSpecial Paste:=xlPasteValues |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using variables when copying values between worksheets
With Sheets("Sheet2")
Worksheets("Sheet1").Cells(5,12).Copy .Range(.Cells(8, EmptyColumn), .Cells _ (8,EmptyColumn+1).PasteSpecial Paste:=xlPasteFormats .Range(.Cells(8, EmptyColumn), .Cells _ (8,EmptyColumn+1).PasteSpecial Paste:=xlPasteValues End With -- Regards, Tom Ogilvy wrote in message oups.com... Hello! I am trying to copy values between two worksheets. On the second worksheet I want to allow users to be able to see scenarios asa the numbers change. So when the user clicks a command button for the first copy we have original values. For the second copy the values will be different. Yet I am having a problem that I can't seem to capture only the value. I read that PasteSpecial should do the trick ... yet I am using variables to pass the columns that I happen to be working with. With the following I get an error. Any tips or clues? Thanks in advance. Worksheets("Sheet1").Cells(5,12).Copy Sheets("Sheet2").Range(Cells(8, EmptyColumn), Cells _(8,EmptyColumn+1).PasteSpecial Paste:=xlPasteFormats Sheets("Sheet2").Range(Cells(8, EmptyColumn), Cells _(8,EmptyColumn+1).PasteSpecial Paste:=xlPasteValues |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying functions without changing most variables in it | Excel Discussion (Misc queries) | |||
copying values from multile worksheets | Excel Discussion (Misc queries) | |||
Compare two variables across two worksheets | Excel Worksheet Functions | |||
Copying a range of values between worksheets | Excel Programming | |||
Copying Variables in VB Editor In Excel | Excel Programming |