+ Reply to Thread
Results 1 to 6 of 6

Macro to copy a specific cell and paste in another cell, for all sheets in workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    06-04-2014
    Posts
    9

    Macro to copy a specific cell and paste in another cell, for all sheets in workbook

    Hi

    I have a macro that will cut and paste cell B11 to cell A13. I need it to do that for every sheet in the workbook. Can someone please help me complete this macro?

    Sub CellCopy()
    
    ' CellCopy Macro
    
    Sheets(1).Activate
    
    For Each Sheet In Sheets
    
    If Sheet.Index  1 Then
    
        Range("B11").Select
    
        Selection.Cut Destination:=Range("A13")
    
        Range("A13").Select
    
        End If
    
    Next Sheet
    
    End Sub

    FYI, I'm doing this from my phone, so it might not be formatted correctly.
    Last edited by lyoung1124; 07-17-2014 at 09:14 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Macro to copy a specific cell and paste in another cell, for all sheets in workbook

    sheets("Sheet1").Range("B11").copy Destination:=Sheet.Range("A13")

    sheet.Range("A13").Select

    also this checking sheet.index<>1 then


    I wouldnt use variable names like that, too confusing use something like wsSheetInspected, as Sheets is a keyword of excel, so mighty close. :o)
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro to copy a specific cell and paste in another cell, for all sheets in workbook

    Sub CellCopy()
    
    Dim ws As Worksheet
    
    For Each ws In Sheets
    
        With ws
    
         .Range("B11").Cut Destination:=.Range("A13")
        
        End With
    
    Next ws
    
    End Sub

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Macro to copy a specific cell and paste in another cell, for all sheets in workbook

    AB33, you're cutting the original back into the original, he needs the index check.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro to copy a specific cell and paste in another cell, for all sheets in workbook

    Nath,
    What is an index check?

  6. #6
    Registered User
    Join Date
    06-04-2014
    Posts
    9

    Re: Macro to copy a specific cell and paste in another cell, for all sheets in workbook

    Thanks AB33. That code worked.

+ 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. Find specific Data copy and paste into Cell Macro VBA
    By kunmateo93 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2014, 10:17 AM
  2. [SOLVED] Macro to copy and paste info into specific cell
    By janeml in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-28-2013, 03:38 PM
  3. Macro to copy specific line from text file and paste into specific cell in excel
    By keeneye in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:35 AM
  4. [SOLVED] Macro - Copy and Paste to a Specific Row based on the input in a cell
    By usc1382 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2012, 05:05 PM
  5. Macro-Copy&Paste Fixed Data Ranges Into Last Empty Cell of Specific Column
    By hailnorm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2009, 10:15 PM

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