Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default I'm Paste values stupid

I'm trying to do something very simple. I go to a sheet and select a range
and click copy to copy a range. I switch to another workbook and click a
button. The code attached to the button should paste values into the active
sheet starting at cell "A3".

It's ridiculous because this should be easy; I even recorded a macro to do
this and the recording fails. Microsoft hasn't improved this yet?????

Here is some of the code I've tried:

ActiveSheet.Range("A3").PasteSpecial Paste:=xlPasteValues
Cells.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Range("A3").PasteSpecial xlPasteValues
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

Any help appreciated...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default I'm Paste values stupid

You say "it fails". What does it do? Do you get an error message? If so,
what does it say? The first line of your code should do what you want. I
use such code in a lot of my projects. Never had a problem. I just placed
your first line of code in a macro (by itself) and it works just fine. I
have 2007. HTH Otto

"xp" wrote in message
...
I'm trying to do something very simple. I go to a sheet and select a range
and click copy to copy a range. I switch to another workbook and click a
button. The code attached to the button should paste values into the
active
sheet starting at cell "A3".

It's ridiculous because this should be easy; I even recorded a macro to do
this and the recording fails. Microsoft hasn't improved this yet?????

Here is some of the code I've tried:

ActiveSheet.Range("A3").PasteSpecial Paste:=xlPasteValues
Cells.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Range("A3").PasteSpecial xlPasteValues
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

Any help appreciated...


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default I'm Paste values stupid

Hi

When you copy a range then press a button in excel (any button) the
copy you just made will be lost. So the result will be nothing
happening or you code bugging out as there is nothing to paste as your
copy was lost.

If you copy and go to the sheet you want to paste it to there is a
pastespecials values button in the customed menu which does just
this.

Right click on your toolbar -Customise, Commands, Edit and choose the
pase values button.

Alternatively if you want a vb solution also, you have to do the copy
and paste together.

Worksheets("Sheet1").Range("A1:A4").Copy 'example range to copy
Worksheets("Sheet2").Range("A3").PasteSpecial xlPasteValues

Take care

Marcus
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default I'm Paste values stupid

You're close, but none of the lines change sheets so you're simply
copy/pasting the results back where you copied them from. If you
really want to go the copy/paste value route, try this:

Range("A3:B5").Copy
Sheets("Sheet2").Range("A3").PasteSpecial Paste:=xlPasteValues

however a faster/more direct alternative would be:
Sheets("Sheet2").Range("A3:B5").Value = Range("A3:B5").Value

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default I'm Paste values stupid

Sub Macro1()
'source workbook
Workbooks("delete_blank_rowsColB.xlsm").Worksheets ("Sheet1").Activate
ActiveSheet.Range("A3").Copy
'destination workbook
Windows("Book3").Activate 'unsaved workbook
ActiveSheet.Range("A3").PasteSpecial Paste:=xlPasteValues
ActiveSheet.Range("A3").PasteSpecial Paste:=xlPasteFormats

End Sub

HTH,
--
Data Hog


"xp" wrote:

I'm trying to do something very simple. I go to a sheet and select a range
and click copy to copy a range. I switch to another workbook and click a
button. The code attached to the button should paste values into the active
sheet starting at cell "A3".

It's ridiculous because this should be easy; I even recorded a macro to do
this and the recording fails. Microsoft hasn't improved this yet?????

Here is some of the code I've tried:

ActiveSheet.Range("A3").PasteSpecial Paste:=xlPasteValues
Cells.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Range("A3").PasteSpecial xlPasteValues
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

Any help appreciated...

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
Find matching values, copy/paste values as well as values in ColA ryguy7272 Excel Programming 2 September 28th 09 06:20 AM
Toolbar Gone - STUPID STUPID STUPID!! Paige Excel Programming 1 June 3rd 09 07:22 AM
Toolbar Gone - STUPID STUPID STUPID!! Simon Lloyd[_1145_] Excel Programming 1 June 2nd 09 04:09 PM
Toolbar Gone - STUPID STUPID STUPID!! Patrick Molloy Excel Programming 0 June 2nd 09 03:52 PM
Stupid, stupid question.... DS Excel Programming 3 September 25th 05 03:51 PM


All times are GMT +1. The time now is 07:41 AM.

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

About Us

"It's about Microsoft Excel"