+ Reply to Thread
Results 1 to 7 of 7

Easy Question (I think) VBA set range equal to another

  1. #1
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Easy Question (I think) VBA set range equal to another

    So I think I must be missing something because I have done VBA code just like this before and it worked fine. For some reason I keep running into an error when I get to this line of code
    Please Login or Register  to view this content.
    z1 and y are both used to count rows on separate sheets. In this case the first instance of z1 is 1 and y is 3.

    Does anyone see what I am doing wrong here?
    Last edited by manofcheese; 06-05-2015 at 11:59 AM.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Easy Question (I think) VBA set range equal to another

    Syntax looks OK, would need to see more context. Also what error you are getting?

  3. #3
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: Easy Question (I think) VBA set range equal to another

    I am running into a Run-Time error 1004

  4. #4
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: Easy Question (I think) VBA set range equal to another

    I tried pulling out just that line into another module and then just put values instead of the variables as well as changing the sheets to their actual sheet names but I am still getting an error.

  5. #5
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Easy Question (I think) VBA set range equal to another

    Ok, would need to see example code and workbook to try to troubleshoot it, because like I said, the syntax of that one line looks ok.

    As an example, this works as expected for me.:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: Easy Question (I think) VBA set range equal to another

    Basically the only other difference is that my code is setting the ranges from different tabs to each other. An example could be
    Please Login or Register  to view this content.
    I just tried this line of code in a new workbook and it didn't work either.

  7. #7
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: Easy Question (I think) VBA set range equal to another

    I figured it out. To do it you need it to be something like this
    Please Login or Register  to view this content.

+ 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. Easy Question
    By chantage in forum Excel General
    Replies: 6
    Last Post: 11-30-2006, 08:22 AM
  2. easy question?
    By kyegibbon in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-13-2006, 04:25 AM
  3. easy vba question
    By Pierre via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-07-2005, 10:25 AM
  4. new user with easy question? not easy for me
    By speakeztruth in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 06-03-2005, 05:05 PM
  5. Easy VBA question: range control
    By J.B. Bobbitt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2005, 09:06 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