+ Reply to Thread
Results 1 to 2 of 2

macro for copying.l

Hybrid View

  1. #1
    Registered User
    Join Date
    04-30-2024
    Location
    India
    MS-Off Ver
    2013
    Posts
    7

    macro for copying.l

    dear experts

    i have a fill with 40 sheets.

    i wa t to copy two column to all the sheets. i intend doing it by "cut and paste" method.

    i wonder can a macro would do it at ease.

    what would be the macro?

    thanks

    M S Narayanan

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,035

    Re: macro for copying.l

    this is untested as you did not offer any sample data or mocked up solution.

    Option Explicit
    
    Sub CopyPaste()
        Dim ws As Worksheet
        Dim rng As Range
        Dim w1 As Worksheet
        Application.ScreenUpdating = False
        w1 = Sheets("Main")                          'Change the name to your ws you are copying from
        Dim lr As Long
        lr = w1.Range("A" & Rows.Count).End(xlUp).Row 'find last cell in column A
        Set rng = w1.Range("A1:B" & lr)              'Range to copy.  Change columns as needed
        For Each ws In Worksheets
            w1.rng Copy                              'copy range
            ws.Range("A1").PasteSpecial xlPasteValues
        Next ws
        Application.CutCopyMode = False
        Application.ScreenUpdating = True
    
    
    
    End Sub
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Macro copying data from HTML document. Not copying 0 from HTML.
    By MartinV10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2019, 03:10 AM
  2. [SOLVED] Copying Macro Code into the Personal Macro Workbook
    By tullybcfc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2013, 07:59 AM
  3. Copying a macro to a different row
    By SARAH_MUNFORD in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2012, 01:13 PM
  4. Replies: 1
    Last Post: 06-24-2010, 09:31 AM
  5. Copying macro
    By ryan_aus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2007, 02:24 AM
  6. [SOLVED] Copying Macro
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2006, 12:20 PM
  7. Macro copying macro code
    By TNSKHelp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-17-2005, 11:59 AM

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