View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] julia.stone@gmail.com is offline
external usenet poster
 
Posts: 18
Default 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