+ Reply to Thread
Results 1 to 3 of 3

Problem with Range,Selection, Copy and Paste

  1. #1
    Registered User
    Join Date
    11-19-2007
    Posts
    2

    Problem with Range,Selection, Copy and Paste

    Hello Excel gurus,

    My problem is that I want to copy information (nx1) from a workbook to another workbook. Since n should be allowed to change from time to time I would like to use the
    Please Login or Register  to view this content.
    and copy the vector from that workbook to my main workbook. I do not know if there are any restrictions using the Range-cells-command compared to the ordinary i.e.
    Please Login or Register  to view this content.
    -version where n is locked at 5. I have used the Windows Activate/Activesheet.Paste command.

    Please Login or Register  to view this content.
    So if you have an alternative way of defining the
    Please Login or Register  to view this content.
    command where the row index is allowed to take different values from time to time please help.

    Kind Regards,

    Peter
    Last edited by VBA Noob; 11-19-2007 at 04:44 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    there's nothing wrong with defining a range that way, but you do not need to select the range.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-19-2007
    Posts
    2
    Quote Originally Posted by royUK
    there's nothing wrong with defining a range that way, but you do not need to select the range.
    Thanks, my code looks like this:

    Worksheets(1).Activate
    With ActiveSheet
    Range(Cells(rad2, kolumn2), Cells(rad2 + (numberofpeople - 1), kolumn2)).Copy
    MsgBox "The name of the active sheet is " & ActiveSheet.Name
    End With

    So the program copies the information from my main sheet to the right range in my main sheet but of course I want the program to copy the information from the workbook I opened. Please tell me how to solve this problem. the Activesheet.Name command says that the opened worksheet is active but still the program copies information from the main workbook.

    Kind 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