Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy, paste to another sheet

Hi,

I would like to copy, paste data from one sheet to another sheet.
I have made command button with this code, and it doesn't work. If someone
can help?

Range("A4:C4").Select
Selection.Copy
Sheets("Data").Select
Range("A2").Select ' code stops on this sentence (even if I put range
A2:C2)
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

Thanks in advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy, paste to another sheet

Sheets("Data").Range("A2:C2").Value = Sheets("Sheet1").Range("A4:C4").Value

Adjust sheet names to match yours.

--
Regards,
Tom Ogilvy

"HrvojeZagi" wrote in message
...
Hi,

I would like to copy, paste data from one sheet to another sheet.
I have made command button with this code, and it doesn't work. If someone
can help?

Range("A4:C4").Select
Selection.Copy
Sheets("Data").Select
Range("A2").Select ' code stops on this sentence (even if I put

range
A2:C2)
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

Thanks in advance




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy, paste to another sheet

If you prefer to go with your current code


Private Sub CommandButton1_Click()
Range("A4:C4").Select
Selection.Copy
Sheets("Data").Select
ActiveSheet.Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
End Sub


--
Regards,
Tom Ogilvy




"HrvojeZagi" wrote in message
...
Hi,

I would like to copy, paste data from one sheet to another sheet.
I have made command button with this code, and it doesn't work. If someone
can help?

Range("A4:C4").Select
Selection.Copy
Sheets("Data").Select
Range("A2").Select ' code stops on this sentence (even if I put

range
A2:C2)
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

Thanks in advance




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Copy, paste to another sheet

use this method if you want formats and values:

Range("A4:C4").Copy
With Sheets("Data").Range("A2")
.PasteSpecial xlPasteAll
.Value = .Value ' omit to keep formulae
End With

Use Tom's method to copy just values...
Sheets("Data").Range("A2:C4").Value = Range("A4:C4").Value




"HrvojeZagi" wrote in message
...
Hi,

I would like to copy, paste data from one sheet to another sheet.
I have made command button with this code, and it doesn't work. If someone
can help?

Range("A4:C4").Select
Selection.Copy
Sheets("Data").Select
Range("A2").Select ' code stops on this sentence (even if I put
range
A2:C2)
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False

Thanks in advance




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
Copy from one Sheet and paste on another sheet based on condition Prem Excel Discussion (Misc queries) 2 December 24th 07 05:05 AM
Active Cell Copy And Paste Sheet to Sheet A.R.J Allan Jefferys New Users to Excel 4 May 4th 06 02:04 AM
Copy paste to another sheet HrvojeZagi Excel Discussion (Misc queries) 2 April 2nd 05 05:54 PM
automatic copy and paste from sheet to sheet in a workbook ramseyjramseyj Excel Programming 6 December 11th 04 12:37 AM
pls help!! copy -paste to another sheet. getting the sum Gale7 Excel Programming 4 October 23rd 03 03:55 PM


All times are GMT +1. The time now is 09:33 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"