+ Reply to Thread
Results 1 to 6 of 6

Copy Cell (Only Value) to different Sheet's Cell

Hybrid View

  1. #1
    Registered User
    Join Date
    01-11-2014
    Location
    TX
    MS-Off Ver
    Excel 2007
    Posts
    21

    Copy Cell (Only Value) to different Sheet's Cell

    Right now, I copy two cells on one sheet, into another sheet's two cells. That works fine. I don't want the formatting to transfer over though, just the values. Also, I don't want to be brought to the new sheet after the paste has been performed.

    Can someone offer advice please?



    Sub Defending_Blue_1()
    Sheets("Battling_Teams").Range("A2").Copy Sheets("Forecast").Range("A5")
    Sheets("Battling_Teams").Range("B3").Copy Sheets("Forecast").Range("A6")
    End Sub
    Last edited by Elieson; 07-22-2015 at 01:24 PM. Reason: Added code txt

  2. #2
    Registered User
    Join Date
    01-11-2014
    Location
    TX
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Copy Cell (Only Value) to different Sheet's Cell

    I've gone through my efforts here and tried something new, but I have an annoying screen flicker (I assume that the macro is quickly jumping back and forth between sheets, before returning me to my first sheet. Is there a way to prevent that from happening?


    Sub Defending_Blue_2()
        Range("C83").Select
        Selection.Copy
        Sheets("Forecast").Select
        Range("A5").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
            
        Sheets("Battling_Teams").Select
        Range("C3").Select
        Selection.Copy
        Sheets("Forecast").Select
        Range("A6").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
            
        Sheets("Battling_Teams").Select
        Application.CutCopyMode = False
    End Sub
    Last edited by Elieson; 07-22-2015 at 01:24 PM. Reason: added code txt

  3. #3
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Copy Cell (Only Value) to different Sheet's Cell

    Your posts violate the rules of this forum. Please put your code in [CODE] tags if you want help. To do this, edit your posts, highlight your code, then press the # button in the text editor toolbar.

  4. #4
    Registered User
    Join Date
    01-11-2014
    Location
    TX
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Copy Cell (Only Value) to different Sheet's Cell

    I've added [code] tags.

  5. #5
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Copy Cell (Only Value) to different Sheet's Cell

    I assume that the macro is quickly jumping back and forth between sheets, before returning me to my first sheet. Is there a way to prevent that from happening?
    Yes, with Application.ScreenUpdating, shown in code below. However, the way I wrote the code, it won't be of too much help here.

    Anyway, a few things.
    1. You don't ever really to do .Select. This is a human activity, and in VBA you can just work with the ranges directly. I've shown that in the code.
    2. When copying just values, w/o formatting, it is my personal preference to just set the ranges equal to each other. I find it more straightforward.

    The following is the functional equivalent of the second code set you posted. It is shorter, and IMHO, clearer.

    Sub Defending_Blue_2()
        Application.ScreenUpdating = False
        Sheets("Forecast").Range("A5").Value = Sheets("Battling_Teams").Range("C83").Value
        Sheets("Forecast").Range("A6").Value = Sheets("Battling_Teams").Range("C3").Value
        Application.ScreenUpdating = True
    End Sub

  6. #6
    Registered User
    Join Date
    01-11-2014
    Location
    TX
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Copy Cell (Only Value) to different Sheet's Cell

    Exactly what I needed. Thanks!

+ 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. Search for a sheet based on a cell copy to that sheet first empyt cell
    By WimpieOosthuizen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2014, 01:47 AM
  2. [SOLVED] Copy cell from 1 sheet to another sheet depending on what info is displayed in a cell
    By chilli76 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-24-2013, 12:33 PM
  3. Replies: 2
    Last Post: 11-18-2013, 07:31 AM
  4. Replies: 2
    Last Post: 10-16-2013, 09:16 AM
  5. copy a specif cell value, find another like that in sheet copy adjacent cell and pate
    By smwaqas89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2013, 10:00 AM
  6. Replies: 0
    Last Post: 06-24-2012, 11:23 AM
  7. Replies: 13
    Last Post: 04-04-2012, 01:25 AM

Tags for this Thread

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