+ Reply to Thread
Results 1 to 2 of 2

moves data from one excel sheet to another

Hybrid View

  1. #1
    Registered User
    Join Date
    09-08-2013
    Location
    Flower Mound, TX.
    MS-Off Ver
    Excel 2007
    Posts
    1

    Unhappy moves data from one excel sheet to another

    Hey guys
    I'm a newbie to the VBA/Excel applications environment and I am having a heck of a time trying to understand and work thru what seems to be a simple copy example that moves data from one excel sheet to another with the following statement:

    Worksheets("Sheet1").Range("A1:A10").Value = Worksheets("Sheet3").Range("B1:B10").Value

    Everytime that I get to this statement & try to execute it I get the following error message:

    RUN-TIME ERROR '9' Subscript out of range!?

    What subscript is actually being referenced in the above statement??

    The following is the actual data that is contained in the worksheet("Sheet1"):

    OneTouch (R) Diabetes Management Software v2.3.3 P1/V2.3.3 10.29.10
    1033 , 1033
    mg/dL
    Date Format : M.D.Y
    Time Format : 24:00
    Total Number of Readings in Data File: 21499
    Patient Name: Johnson, Thomas Roy
    Sample # Date Time Med Strength
    21499 07/17/13 7:59 PM 2.5 CFT0437DV
    21498 07/17/13 7:59 PM 1 CFT0437DV


    All I want to do is move this data from one sheet to another *** the statement suggest but there seems to be an issue with what I have provided in the VBA statement. If someone can point out the error of my ways, I would greatly appreciate it.

    Thanks in advance . . .
    TomJ.
    Last edited by vlady; 09-17-2013 at 07:27 PM.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: moves data from one excel sheet to another

    Hi,

    this error pops up when one of the worksheets does not exist in the activated workbook. Please make sure that "Sheet1" and "Sheet3" are the worksheet names you also see in the tabs.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

+ 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. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  2. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  3. [SOLVED] Runtime Error - Subscript out of range despite On Error statement
    By DoctorG in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-28-2006, 11:05 AM
  4. Path/File access error (Error 75) using Name Statement
    By blayne in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-22-2005, 05:25 PM
  5. Path/File access error (Error 75) after using Name Statement
    By blayne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-09-2005, 08:35 PM

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