+ Reply to Thread
Results 1 to 3 of 3

CopyData From one sheet to other sheet

Hybrid View

vshukla CopyData From one sheet to... 05-03-2015, 05:29 AM
mehmetcik Re: CopyData From one sheet... 05-03-2015, 05:49 AM
JOHN H. DAVIS Re: CopyData From one sheet... 05-04-2015, 08:06 AM
  1. #1
    Registered User
    Join Date
    03-01-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    CopyData From one sheet to other sheet

    Hi,

    I am trying to a column data from one sheet to other workbook which is already saved at the other location.
    but I am able to open the workbook but while pasting the data it is giving me object error which I am not able to figure out.
    I am attaching the sample files I am trying to copy data from Mail_file column F2:F15 to Base File next blank column in row 2
    Mail_File.xlsmBase File.xlsx
    Please help.


    Sub CopyPaste()
    Sheet1.Activate

    Sheet1.Range("F2:F15").Copy

    Workbooks.Open ("C:\Users\Vipin\Desktop\BAse File.xlsx")


    With ActiveSheet
    LastCol = .Cells(2, .Columns.Count).End(xlToLeft).Column + 1

    End With

    Sheet1.Cells(2, LastCol).PasteSpecial xlAllValues



    Application.CutCopyMode = False
    End Sub

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: CopyData From one sheet to other sheet

    
    MyName = activeworkbook.name
    
    Workbooks.Open ("C:\Users\Vipin\Desktop\BAse File.xlsx")
    NextCol = Cells(2, .Columns.Count).End(xlToLeft).Column + 1
    
    Workbooks("BAse File.xlsx").Sheets("sheet1").Range(cells(2, NextCol),cells(15,Nextcol)) = Workbooks(MyName).Sheets("sheet1").Range("F2:F15").Value*
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: CopyData From one sheet to other sheet

    Please use code tags when posting code too the Forum:

    Maybe:

    Sub vsukla()
    Dim ws As Worksheet
    Set ws = Sheets("Sushil")
    
    Workbooks.Open ("C:\Users\Vipin\Desktop\BAse File.xlsx")
    lastcol = Cells(2, Columns.Count).End(xlToLeft).Column + 1
    Cells(2, lastcol).Resize(14).Value = ws.Range("F2:F15").Value
    
    
    End Sub

+ 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. Lookup Value from Sheet 4 in Sheet 2, if found copy Sheet 2 Active Row to Sheet 5
    By lgosso23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2013, 02:51 PM
  2. [SOLVED] find code# from sheet 1 on sheet 2, compare value on sheet 1 with value on sheet 2
    By BlakeLee in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-27-2013, 01:52 PM
  3. Replies: 11
    Last Post: 10-14-2012, 01:03 PM
  4. Open other workbook, copydata..?
    By pallar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-27-2010, 01:19 AM
  5. [SOLVED] macro CopyData Help
    By formula using percentage question in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-09-2006, 09:10 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