+ Reply to Thread
Results 1 to 2 of 2

Duplicate Sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2003
    Posts
    4

    Cool Duplicate Sheet

    I have an excel file that imports data from SQL everytime it opens, I then have second sheet, on which I want the same data but I want to add a row.

    I was using the simple =sheet1!A1 command copy and pasting. But.... Obviosuly the size of the data changes all the time and also if I try to paste to the "entire" sheet. It just barfs at me ;-)

    So I am looking for a formula or vba that will only duplicate a cell that has data to another sheet.

    Anyone??

    Cheers

  2. #2
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Duplicate Sheet

    use this code
    Dim a, b, sel_rg
    Sheet1.Activate
    a = Cells(1, Columns.Count).End(xlToLeft).Column
    b = Cells(Rows.Count, 1).End(xlUp).Row
    sel_rg = "A1:" & Cells(1, a) & b
        Range(sel_rg).Select
        Selection.Copy
        Sheets("Sheet3").Select
        Range("A1").Select
        ActiveSheet.Paste
    Kamboj
    _________________________________________________________________________________
    Mark the thread as SOLVED if my answer satisfy you.

+ 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. [SOLVED] VBA - Macro issue copy/paste line other sheet + duplicate current sheet
    By vcourbiere in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-17-2014, 12:06 PM
  2. Insert a row, duplicate a sheet and copy cells to master sheet?
    By Dagoom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-25-2013, 01:26 AM
  3. Preventing duplicate entry of a row in Sheet 2 while copying selected rows from Sheet 1
    By Pavan Renjal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-31-2012, 04:27 PM
  4. [SOLVED] Duplicate sheet but change sheet name and date on multiple rows
    By hambly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2012, 09:39 AM
  5. Count the number of duplicates in a sheet, report the duplicate cells to a new sheet.
    By SamPetroda in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2012, 09:48 AM
  6. Search column a for duplicate data and copy entire row to duplicate sheet
    By crazyAMP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2012, 08:21 PM
  7. Replies: 2
    Last Post: 12-22-2008, 02:01 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