+ Reply to Thread
Results 1 to 4 of 4

copy and paste is not working (VBA)

  1. #1
    Forum Contributor
    Join Date
    01-06-2017
    Location
    india
    MS-Off Ver
    2010
    Posts
    118

    copy and paste is not working (VBA)

    Hi,


    Below VBA code is not working. Pls go through it and help me.


    ThisWorkbook.Sheets("sheet1").Range(Cells(2, 4), Cells(2, 7)).Copy Destination:=ThisWorkbook.Sheets("sheet1").Range(Cells(3, 4), Cells(gbplr, 7))

    Note=here "gbplr" means last row in the sheet.

    regards
    shiva
    Last edited by shiva_raj; 04-22-2017 at 10:32 PM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: copy and paste is not working (VBA)

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-06-2017
    Location
    india
    MS-Off Ver
    2010
    Posts
    118

    Re: copy and paste is not working (VBA)

    where is the mistake in my code?

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: copy and paste is not working (VBA)

    Your code runs properly only if Sheet1 is active, or the code is written in Sheet1 code module.
    If you run the code from other sheet, Range/Cells object should be qualified with its parent object(sheet).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy Paste not Working
    By VaibhavAr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2016, 11:28 PM
  2. Copy/Paste Not Working
    By Rheanna in forum Excel General
    Replies: 3
    Last Post: 07-27-2015, 01:10 PM
  3. Copy paste - cute paste macro almost working
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2014, 12:33 PM
  4. Replies: 2
    Last Post: 08-17-2012, 08:16 AM
  5. Replies: 2
    Last Post: 03-27-2012, 02:49 PM
  6. Copy and Paste Not Working
    By dstromain in forum Excel General
    Replies: 1
    Last Post: 10-14-2005, 09:05 AM
  7. copy paste is not working
    By Becky1810 in forum Excel General
    Replies: 1
    Last Post: 07-16-2005, 10:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1