none
RANGE SELECTION ERROR RRS feed

Answers

  • Hi,

    You need to add the sheet name to make sure the selected range is  in Sheet6 when you operate code in Sheet1.  You can use the following code to copy and paste the range.

    Private Sub CommandButton21_Click()
        Worksheets("PERMANENT ARTICLES LIST").Select
        Range("A9:M65").Select
        Selection.copy
        Worksheets("Sheet6").Select
    WorkSheets(“Sheet6”).Range(“A9”).Select

     Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
            SkipBlanks:=False, Transpose:=False
        ActiveSheet.Paste
     End With
       
    End Sub

    Hope this will help you

    Best Regard

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 11, 2015 9:11 AM
    Moderator

All replies

  • Hi,

    I think you need to select one cell instead of a range to paste you copied selection. Can you try that? Is your code running know? If no, what is the error?

    I also tested a little part of the code with an example of my own, below code works. Maybe this will help you. Sometimes recording also helps to solve you issue.

    Sub test()
    
    Sheets("sheet1").Select
    Range("D4:E8").Copy
    Sheets("sheet2").Select
    Range("D4").Select
    ActiveSheet.paste
    
    End Sub

    Regards,

    Reshma


    Please Vote as Helpful if an answer is helpful and/or Please mark Proposed as Answer or Mark As Answer when question is answered



    Sunday, March 8, 2015 1:28 PM
  • Hi Reshma Mahabir,

    Thank you,

    I tried selecting single cell but not working.

    regards

    Sunday, March 8, 2015 6:15 PM
  • Hi,

    Can you change the first part, like this:

    Private sub CommantButton21_Click()
      Worksheets("PERMANENT ARTICLES LIST").Select
      Range("A4:M9").Copy
      Worksheets("sheet6").select
      Range("A4").Select
      Activesheet.Paste
    etc. code

    Hope it helps.

    Reshma


    Please Vote as Helpful if an answer is helpful and/or Please mark Proposed as Answer or Mark As Answer when question is answered

    Sunday, March 8, 2015 7:06 PM
  • Hi,

    I tried it earlier and again now.

    Not working

    thank you.

    Monday, March 9, 2015 12:59 AM
  • Hi,

    Is it possible to post or email your Excel file, this way I can test your code.

    Hope to hear from you.

    Regards,

    Reshma


    Please Vote as Helpful if an answer is helpful and/or Please mark Proposed as Answer or Mark As Answer when question is answered

    Monday, March 9, 2015 7:13 PM
  • please this link

    https://onedrive.live.com/redir?resid=90B1344C0622B513!9292&authkey=!AK1FB6gciku4ur0&ithint=file%2cxlsm

    http://1drv.ms/1KO9mZA

    Tuesday, March 10, 2015 2:15 AM
  • Hi,

    You have merged cells in Sheet "Permanent Articles List". Because this is the source and the target has not got merged cells your pasting will not work unless you create the same merged cells on Sheet 6.

    So in Sheet6 create merged cells exactly the same as in the "Permanent Articles List" with no content and then try the solution Reshma gave you it will work. I think your own code will work as well then.

    Maurice


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. Thank You

    Tuesday, March 10, 2015 7:39 AM
  • Hi,

    What error you have got, I have downloaded the file and tested it in Excel 2013, without the last sentence "Application.PrintCommunication = True " it works fine. But when run with the lase sentenceit shows runtime error 1004, method"PrintCommunication" of 'object_APPlication'. Are you working with printers ? If it is, here is a similar thread  how to fix the error

    Excel 2010 VBA: Errors with Application.PrinterCommunications (Error 1004)

    Hope this will help you.

    Best Regards

    Lan


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 10, 2015 9:58 AM
    Moderator
  • Hi,

    Thank you Lanlan Huang,

    Only problem here is , that it does not keep the cell top most and left A9. It keeps that cell which was clicked last time in target worksheet and everything is brought to right and downwards to this cell. In other words,

    Worksheets("sheet6").select

    range("A4:M9").select

    In my uploaded file, it is range("A9").select not working

    regards

    Tuesday, March 10, 2015 2:34 PM
  • Hi,

    You need to add the sheet name to make sure the selected range is  in Sheet6 when you operate code in Sheet1.  You can use the following code to copy and paste the range.

    Private Sub CommandButton21_Click()
        Worksheets("PERMANENT ARTICLES LIST").Select
        Range("A9:M65").Select
        Selection.copy
        Worksheets("Sheet6").Select
    WorkSheets(“Sheet6”).Range(“A9”).Select

     Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
            SkipBlanks:=False, Transpose:=False
        ActiveSheet.Paste
     End With
       
    End Sub

    Hope this will help you

    Best Regard

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 11, 2015 9:11 AM
    Moderator
  • Hi Lanlan Huang,

    Thank you,

    Now it is working.

    Wednesday, March 11, 2015 6:21 PM