Results 1 to 3 of 3

Copy to Clipboard VBA

This is a discussion on Copy to Clipboard VBA within the Excel Questions forums, part of the Question Forums category; I apologize for any newb mistakes. I am new to learning excel and real new to VBA code. I was ...

  1. #1
    New Member
    Join Date
    Sep 2013
    Posts
    12

    Default Copy to Clipboard VBA

    I apologize for any newb mistakes. I am new to learning excel and real new to VBA code. I was wondering if anyone can help me with a code.
    I want to have a Axtive X Command button then when you click the button it copies the text contents from another sheet without switching and highlighting that cell (silent?) i have code for copying to clipboard from the same sheet but it only works well when the command button is on the same sheet on top of the cell. If you move the text it will jump and highlight that cell. Again i apologize if its not clear what i am looking for. Here is the code i have that works for copy to clipboard using the command button.

    Private Sub CommandButton1_Click()
    Range("F48").Select
    Selection.Copy

  2. #2
    Board Regular
    Join Date
    Jan 2012
    Posts
    253

    Default Re: Copy to Clipboard VBA

    Hello,

    Change the sheet name with the one you need

    Code:
    Private Sub CommandButton1_Click()    
    Sheets("sheet name").Range("F48").Copy
    End Sub

  3. #3
    New Member
    Join Date
    Sep 2013
    Posts
    12

    Default Re: Copy to Clipboard VBA

    Works Perfect Thank you very much!

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com