+ Reply to Thread
Results 1 to 4 of 4

Copy cell value to other worksheet (without copy, pasting and selecting?)

  1. #1
    Registered User
    Join Date
    07-26-2010
    Location
    NL
    MS-Off Ver
    Excel 2016
    Posts
    74

    Copy cell value to other worksheet (without copy, pasting and selecting?)

    Hi,

    I'm trying to copy cell values from a source sheet to another worksheet, therefore I set the activeworkbook as wb1 and open the second workbook as wb2.

    Please Login or Register  to view this content.
    My code fails on the wb2.ws2 part, what going wrong?

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,231

    Re: Copy cell value to other worksheet (without copy, pasting and selecting?)

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    07-26-2010
    Location
    NL
    MS-Off Ver
    Excel 2016
    Posts
    74

    Re: Copy cell value to other worksheet (without copy, pasting and selecting?)

    Quote Originally Posted by sintek View Post
    Please Login or Register  to view this content.
    Thanks!

    So it was purely caused by the incorrect Dim?

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,231

    Re: Copy cell value to other worksheet (without copy, pasting and selecting?)

    Your variable declarations were incorrect ...
    Please Login or Register  to view this content.
    this means ws1 is a variant and ws2 is a worksheet

    but also...You were referencing the sheet in wb2 incorrectly
    Please Login or Register  to view this content.
    the red part must be left out
    Last edited by sintek; 04-30-2019 at 06:59 AM.

+ 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 and Pasting to another worksheet if cell value equals name of worksheet
    By Andrewstupendo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2016, 03:53 PM
  2. Replies: 2
    Last Post: 06-08-2016, 06:25 AM
  3. Replies: 1
    Last Post: 05-13-2014, 01:28 AM
  4. Replies: 1
    Last Post: 05-12-2014, 10:57 PM
  5. Copy/Pasting in another worksheet using VBA
    By amotz in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-07-2012, 07:40 PM
  6. Selecting, copy and pasting cells
    By patigonia in forum Excel General
    Replies: 9
    Last Post: 05-29-2012, 09:08 PM
  7. Selecting Active Rows after autofiltering copy, pasting and deleting
    By mopatz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2008, 12:41 PM

Tags for this Thread

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