+ Reply to Thread
Results 1 to 3 of 3

Copying columns from one workbook to another

  1. #1
    Registered User
    Join Date
    01-28-2004
    Posts
    2

    Copying columns from one workbook to another

    Hello.
    I know this could be very simple but anyway... it does not for me!

    I have a template. I click the button which should open a workbook (with measurement data). I want to copy column C from this opened file to template, first free column (starting with B).

    sheets("data").range("C:C").copy destination:=workbooks("template").sheets("data_T").range("B:B")

    I have also tried to record a macro while doing this copy. I used exactly the same code but it does not work.

    example:
    columns("C:C").select
    this also does not work on opened file


    What could be the problem? Can anyone please help me?

    Thank you.
    Peter.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Peterl,

    You code is fine which leads to believe that one or more of the Worksheets or Workbooks maybe protected. It would help when post about a problem to also include any error messages you have received.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    01-28-2004
    Posts
    2
    Hi, I get the following error:

    "Run-time error '1004':

    Method Select of class Range not ... (literally translated from my language)

    Regards
    Peter.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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