Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying functions without changing most variables in it Ruleroftheblind Excel Discussion (Misc queries) 3 March 12th 09 04:54 AM
copying values from multile worksheets cking015 Excel Discussion (Misc queries) 1 June 20th 08 07:30 PM
Compare two variables across two worksheets jlcnewyork Excel Worksheet Functions 0 February 14th 06 08:58 PM
Copying a range of values between worksheets Christopher R. Lee Excel Programming 2 February 6th 05 09:08 PM
Copying Variables in VB Editor In Excel Tony Excel Programming 10 November 2nd 03 10:04 PM


All times are GMT +1. The time now is 04:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"