+ Reply to Thread
Results 1 to 5 of 5

copy data

  1. #1
    Forum Contributor
    Join Date
    06-27-2014
    Location
    bristol, england
    MS-Off Ver
    excel 2007
    Posts
    264

    copy data

    Hi all, i have the code below for copying data from one workbook to another, which works reasonably well, the only problem is on the worksheet that is being copied some data is entered via dropdown boxes and some cells have comments attached, the code I am using copies everything including the comments and dropdown boxes, what do I need to change so it only copies the actual data?
    2) I would like 2 columns A & B to be checked for duplicates before the data is copied, if duplicates are found then the code to stop running
    hop this makes sense

    scouse13


    [\code]
    Sub copytoworkMon()

    wb = ActiveWorkbook.Name
    Windows(wb).Activate
    Range("A5:V550").Copy
    Windows("HelpDeskWorkingSheet").Activate
    Sheets("WorkingMon").Select
    Range("A5:V550").PasteSpecial
    Application.CutCopyMode = False

    Windows("Sinbin.xls").Activate
    Sheets("Monday").Select

    End Sub
    [/code]

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: copy data

    Hi there,

    The following code will copy the data values from the specified range in the active worksheet to the same range in the specified target workbook and worksheet:

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your own requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Forum Contributor
    Join Date
    06-27-2014
    Location
    bristol, england
    MS-Off Ver
    excel 2007
    Posts
    264

    Re: copy data

    thanks Greg m worked a treat

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: copy data

    Hi again,

    Many thanks for your very prompt feedback.

    You're welcome - glad I was able to help.

    Best regards,

    Greg M

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: copy data

    Hi,

    It looks like in Excel 2010 and newer they have built into the VBA the ability to use all the Paste Special features. Read about it at:

    https://blog.udemy.com/pastespecial-vba/
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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. Copy & paste input data to sheet, copy result back out
    By stuartsjg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-30-2015, 05:25 PM
  2. Saving copy of data and then running macro on all active worksheets in saved copy?
    By Science87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2014, 11:56 AM
  3. [SOLVED] Copy data with 4 cell interval and copy range of data like vlookup with structured output
    By Daydreams in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-23-2013, 04:08 AM
  4. Replies: 4
    Last Post: 05-20-2013, 11:37 AM
  5. Enter data, copy formulas, copy values, paste data, delete data
    By alf40 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2013, 07:23 PM
  6. Copy/Paste range of data excluding certain rows and copy to another workbook
    By HoerbigAdm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2012, 02:51 PM
  7. Macro to copy Dyanmic lists then copy sheet and clear the original data
    By twiggywales in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2012, 01:06 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