• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

copy paste special values

sreejeshc

New Member
Please help me in the below code for paste special values.


Range(ActiveCell.Offset(0, -9), ActiveCell).Copy Sheets("c").Range("a65536").End(xlUp).Offset(1, 0)
 
Hi sreejeshc,


Can you please try the below for me.

[pre]
Code:
Range(ActiveCell.Offset(0, -9), ActiveCell).Copy
Sheets("c").Range("a65536").End(xlUp).Offset(1, 0).PasteSpecial xlValues
[/pre]
Regards,

Deb
 
Hi,


Try this


Selection.Offset(0, -9).Select

Selection.Copy

Sheets("c").Range("a65536").End(xlUp).Offset(1, 0).PasteSpecial xlValues


Thanks,

Suresh Kumar S
 
Hi Sreejesh ,


There is no problem with your code ; the problem is which is your Activecell ?


Since you are offsetting your activecell by -9 columns i.e. 9 columns to the left , if your activecell is such that there does not exist a column which is 9 columns to the left of the activecell , Excel will generate an error.


Your activecell has to be in column J or beyond ( K , L ,... ) for Excel not to generate an error.


Narayan
 
Hi Sreejeshc,


Two Conditions are mandatory

1. Selection.Offset(0, -9).Select this function will copy the values from current location to minus of 9 Column (For example if the cursor is in "O1" Column then it will go to the "F1" column and copy the value)

2. Sheet name should be C (As you mentioned in the code)


Still it is not running please download the below file and check.


http://www.2shared.com/document/Zptj6EoU/c_online.html


Good Night.

Thanks,

Suresh Kumar S
 
Back
Top