+ Reply to Thread
Results 1 to 11 of 11

Copy+Paste Special Single Cell on all sheets

  1. #1
    Registered User
    Join Date
    11-23-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Copy+Paste Special Single Cell on all sheets

    Hey,

    Can anyone help me write a macro that will take the cell I have currently selected and copy and paste special the value in that cell and then do the same on each sheet in the workbook? Each sheet will have a different number to copy/paste special, but the cell location will be the same across each sheet.

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,062

    Re: Copy+Paste Special Single Cell on all sheets

    eg1,

    I'm not sure I understand what you want. Are you simply wanting to convert the selected cell to values? Maybe like you click on A3, which is a formula, and you want to replace it with the value? Is that what you're looking for?

  3. #3
    Registered User
    Join Date
    11-23-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copy+Paste Special Single Cell on all sheets

    Quote Originally Posted by jomili View Post
    eg1,

    I'm not sure I understand what you want. Are you simply wanting to convert the selected cell to values? Maybe like you click on A3, which is a formula, and you want to replace it with the value? Is that what you're looking for?
    Exactly. But I have about 50+ sheets in the workbook that all need a single cell to be converted from a formula to just a numeric value.

  4. #4
    Registered User
    Join Date
    11-23-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copy+Paste Special Single Cell on all sheets

    I was able to get this far just by recording in relative reference mode, but I do not know how to get it to repeat on all sheets:



    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False

  5. #5
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Copy+Paste Special Single Cell on all sheets

    You can use this

    Please Login or Register  to view this content.
    Please take time to read the forum rules

  6. #6
    Registered User
    Join Date
    11-23-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copy+Paste Special Single Cell on all sheets

    Quote Originally Posted by Steffen Thomsen View Post
    You can use this

    Please Login or Register  to view this content.
    This worked for the page I was on but I would like to to repeat for all sheets in the workbook.

  7. #7
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,062

    Re: Copy+Paste Special Single Cell on all sheets

    Or
    Please Login or Register  to view this content.
    By "Repeat on every sheet" are you saying that the value in A3 in sheet1 needs to pasted into each sheet in A3?
    Or are you saying the value in A3 on every sheet needs to be converted to it's value?

  8. #8
    Registered User
    Join Date
    11-23-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copy+Paste Special Single Cell on all sheets

    Quote Originally Posted by jomili View Post
    Or
    Please Login or Register  to view this content.
    By "Repeat on every sheet" are you saying that the value in A3 in sheet1 needs to pasted into each sheet in A3?
    Or are you saying the value in A3 on every sheet needs to be converted to it's value?
    The value in A3 on every sheet needs to be converted to it's respective value.

  9. #9
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Copy+Paste Special Single Cell on all sheets

    As i understood it, it was a different cell each time.

  10. #10
    Registered User
    Join Date
    11-23-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copy+Paste Special Single Cell on all sheets

    Quote Originally Posted by Steffen Thomsen View Post
    As i understood it, it was a different cell each time.
    I figured it out using the following:

    Code:

    Sub CopyReplace()

    Dim ws As Worksheet
    For Each ws In Sheets
    If ws.Visible Then ws.Select (False)
    Next

    ActiveCell.Copy
    ActiveCell.PasteSpecial xlValues
    Application.CutCopyMode = False

    End Sub

  11. #11
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,062

    Re: Copy+Paste Special Single Cell on all sheets

    EG1, If I'm reading your code right, what it's going to do is 1) Select each sheet, one at a time, then 2) determine which cell is the active cell on that sheet (which may or may not correspond with the active cell on the sheet you started with) and 3) convert that active cell to values.


    You can do it like this. This would run faster, as there's no selecting, no copying, and no pasting, and it will hit the same location as your starting sheet.
    Please Login or Register  to view this content.

+ 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