+ Reply to Thread
Results 1 to 3 of 3

macro sheet position

  1. #1
    Registered User
    Join Date
    05-16-2006
    Posts
    18

    macro sheet position

    I have this code below. i want it to perform a task on project list sheet while the button to execute the code is on another sheet, but its executing the task on the same sheet the button is on, hence taking the wrong data. what am i missing from the code?
    Please Login or Register  to view this content.
    thanks

    Jamie

  2. #2
    Arvi Laanemets
    Guest

    Re: macro sheet position

    Hi

    ....
    Sheets(SourceSheet).Range(SourceRange).Copy
    Sheets(TargetSheet).Range(TargetRange).Paste
    ....

    (no need to activate/select any sheet when doing copy/paste - so it works
    much faster and the screen isn't blinking too)


    --
    Arvi Laanemets
    ( My real mail address: arvi.laanemets<at>tarkon.ee )



    "jay d" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have this code below. i want it to perform a task on project list
    > sheet while the button to execute the code is on another sheet, but its
    > executing the task on the same sheet the button is on, hence taking the
    > wrong data. what am i missing from the code?
    >
    > Code:
    > --------------------
    > Sub smi()
    > '
    > ' smi Macro
    > '
    > Range("A4:A" & Range("A3").End(xlDown).Row & ",D4:E" &
    > Range("A3").End(xlDown).Row).Select
    > Selection.Copy
    > Sheets("Project List").Select
    > Range("A" & ((Range("A3").End(xlDown).Row) + 1)).Select
    > ActiveSheet.Paste
    >
    > End Sub
    > --------------------
    >
    >
    > thanks
    >
    > Jamie
    >
    >
    > --
    > jay d
    > ------------------------------------------------------------------------
    > jay d's Profile:
    > http://www.excelforum.com/member.php...o&userid=34487
    > View this thread: http://www.excelforum.com/showthread...hreadid=548522
    >




  3. #3
    Registered User
    Join Date
    05-16-2006
    Posts
    18
    thanks

    im not really a competant coder, i replaced what i had with what you said but it does not work, is it the wrong order?

    Please Login or Register  to view this content.
    it was saying there is a problem with line 5, the copy line...

    Jamie

+ 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