+ Reply to Thread
Results 1 to 2 of 2

Copy Format and Data

Hybrid View

freqzz Copy Format and Data 08-23-2015, 10:31 PM
freqzz Re: Copy Format and Data 08-24-2015, 08:41 PM
  1. #1
    Registered User
    Join Date
    10-09-2011
    Location
    Kuala Lumpur
    MS-Off Ver
    Excel 2003
    Posts
    19

    Copy Format and Data

    Hi all,

    I am trying to copy format and data from different worksheet.

    I have no issue on copying the format from "Template" sheet but having problem copying data from other sheet matching the column once the format have been completed.

    The idea is to

    1 - copy format from template
    2 - copy data fill in template based on column criteria

    Example code

    Sub SheetsFromTemplate()
    
    Dim wsMASTER As Worksheet, wsTEMP As Worksheet, wasVISIBLE As Boolean
    Dim shNAMES As Range, Nm As Range
    
    With ThisWorkbook
        Set wsTEMP = .Sheets("Template")
        wasVISIBLE = (wsTEMP.Visible = xlSheetVisible)
        If Not wasVISIBLE Then wsTEMP.Visible = xlSheetVisible
        
        Set wsMASTER = .Sheets("Sandbox")
                                                                    
        Set shNAMES = wsMASTER.Range("D4:D" & Columns.Count).SpecialCells(xlConstants)
        
        Application.ScreenUpdating = False
        For Each Nm In shNAMES
            If Not Evaluate("ISREF('" & CStr(Nm.Text) & "'!A1)") Then
                wsTEMP.Copy After:=.Sheets(.Sheets.Count)              'copy according to template
                xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx                       'copy data matching column name
                ActiveSheet.Name = CStr(Nm.Text)
                
                 
            End If
        Next Nm
        
        wsMASTER.Activate
        If Not wasVISIBLE Then wsTEMP.Visible = xlSheetHidden
        Application.ScreenUpdating = True
    End With
    
    End Sub
    xxxxxx is where i hope to put the code so it does loop and copy the data into the newly created sheet.

    Thanks in advance

  2. #2
    Registered User
    Join Date
    10-09-2011
    Location
    Kuala Lumpur
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Copy Format and Data

    no help?

+ 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. Replies: 0
    Last Post: 08-17-2013, 02:55 PM
  2. Employee Schedule - Copy over data in different format
    By jpecor2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2013, 11:58 AM
  3. Data format copy
    By onenessboy in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-11-2012, 07:06 AM
  4. [SOLVED] Copy data in one format from Sheet1 and paste to another sheet in another format.
    By FergusC in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2012, 08:36 PM
  5. copy past format last row of data
    By fengfeng in forum Excel General
    Replies: 1
    Last Post: 06-30-2009, 02:31 AM
  6. Copy rows of data into a different format
    By Dave32 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2008, 01:13 PM
  7. [SOLVED] Lock Cell Format - Allow copy and paste of data without format change
    By Chris12InKC in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-11-2006, 12:50 AM
  8. Replies: 1
    Last Post: 06-27-2005, 06:05 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