Results 1 to 14 of 14

Problem Moving Data from one Sheet to Another

Threaded View

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    36

    Problem Moving Data from one Sheet to Another

    Hello ExcelForum,

    I am writing a macro for data transfer from one sheet to another in Excel 2003 and so far this is what I have;

    Sub PMoveData()
    ' PMoveData Macro
    ' Macro to move raw data from "P" to PDat
     Sheets("P").Select
        Range("E5:S5").Select
        Selection.Copy
        Sheets("PDat").Select
        Range("C45").Select
        ActiveSheet.Paste
    Sheets("P").Select
        Range("E26:S26").Select
        Selection.Copy
        Sheets("PDat").Select
        Range("C46").Select
        ActiveSheet.Paste
    Sheets("P").Select
        Range("E47:S47").Select
        Selection.Copy
        Sheets("PDat").Select
        Range("C47").Select
        ActiveSheet.Paste
    End Sub
    But when I run that code, it stops at the first

    Sheets("P").Select
    and tells me that the subscript is out of range.


    If I get rid of the

    Sheets("P").Select
    it works fine for the first selection as long as I start on the "P" sheet, but messes up the rest.

    Please let me know how to properly select each sheet so I can transfer the data correctly.

    Thanks!!
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] problem with moving data to new sheet when row A of new sheet does not have data
    By CityInspector in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-23-2012, 09:16 AM
  2. Replies: 2
    Last Post: 10-09-2012, 08:40 PM
  3. Replies: 2
    Last Post: 03-23-2009, 10:17 AM
  4. Problem moving data between worksheets
    By Timeferret in forum Excel General
    Replies: 3
    Last Post: 02-10-2009, 05:29 AM
  5. [SOLVED] Problem moving data
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2006, 06:15 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